diff --git a/cef.gyp b/cef.gyp index be587d346..5ba76b1da 100644 --- a/cef.gyp +++ b/cef.gyp @@ -29,7 +29,7 @@ 'mac_bundle': 1, 'msvs_guid': '6617FED9-C5D4-4907-BF55-A90062A6683F', 'dependencies': [ - '../third_party/npapi/npapi.gyp:npapi', + '<(DEPTH)/third_party/npapi/npapi.gyp:npapi', 'libcef', 'libcef_dll_wrapper', ], @@ -38,7 +38,9 @@ ], 'include_dirs': [ '.', - '..', + # cefclient includes are relative to the tests directory to make + # creation of binary releases easier. + 'tests' ], 'sources': [ '<@(includes_common)', @@ -298,12 +300,12 @@ 'mac_bundle': 1, 'msvs_guid': '8500027C-B11A-11DE-A16E-B80256D89593', 'dependencies': [ - '../base/base.gyp:base', - '../base/base.gyp:base_i18n', - '../base/base.gyp:test_support_base', - '../testing/gtest.gyp:gtest', - '../third_party/icu/icu.gyp:icui18n', - '../third_party/icu/icu.gyp:icuuc', + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/base/base.gyp:base_i18n', + '<(DEPTH)/base/base.gyp:test_support_base', + '<(DEPTH)/testing/gtest.gyp:gtest', + '<(DEPTH)/third_party/icu/icu.gyp:icui18n', + '<(DEPTH)/third_party/icu/icu.gyp:icuuc', 'libcef', 'libcef_dll_wrapper', ], @@ -348,7 +350,6 @@ }, 'include_dirs': [ '.', - '..', ], 'conditions': [ [ 'OS=="mac"', { @@ -431,42 +432,42 @@ 'type': 'shared_library', 'msvs_guid': 'C13650D5-CF1A-4259-BE45-B1EBA6280E47', 'dependencies': [ - '../base/base.gyp:base', - '../base/base.gyp:base_i18n', - '../build/temp_gyp/googleurl.gyp:googleurl', - '../media/media.gyp:media', - '../net/net.gyp:net', - '../net/net.gyp:net_resources', - '../printing/printing.gyp:printing', - '../sdch/sdch.gyp:sdch', - '../skia/skia.gyp:skia', - '../third_party/bzip2/bzip2.gyp:bzip2', - '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg', - '../third_party/icu/icu.gyp:icui18n', - '../third_party/icu/icu.gyp:icuuc', - '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', - '../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', - '../third_party/libpng/libpng.gyp:libpng', - '../third_party/libxml/libxml.gyp:libxml', - '../third_party/libxslt/libxslt.gyp:libxslt', - '../third_party/modp_b64/modp_b64.gyp:modp_b64', - '../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', - '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', - '../third_party/zlib/zlib.gyp:zlib', - '../ui/ui.gyp:gfx_resources', - '../ui/ui.gyp:ui', - '../v8/tools/gyp/v8.gyp:v8', - '../webkit/support/webkit_support.gyp:appcache', - '../webkit/support/webkit_support.gyp:blob', - '../webkit/support/webkit_support.gyp:database', - '../webkit/support/webkit_support.gyp:fileapi', - '../webkit/support/webkit_support.gyp:glue', - '../webkit/support/webkit_support.gyp:quota', - '../webkit/support/webkit_support.gyp:webkit_gpu', - '../webkit/support/webkit_support.gyp:webkit_media', - '../webkit/support/webkit_support.gyp:webkit_resources', - '../webkit/support/webkit_support.gyp:webkit_strings', - '../webkit/support/webkit_support.gyp:webkit_user_agent', + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/base/base.gyp:base_i18n', + '<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl', + '<(DEPTH)/media/media.gyp:media', + '<(DEPTH)/net/net.gyp:net', + '<(DEPTH)/net/net.gyp:net_resources', + '<(DEPTH)/printing/printing.gyp:printing', + '<(DEPTH)/sdch/sdch.gyp:sdch', + '<(DEPTH)/skia/skia.gyp:skia', + '<(DEPTH)/third_party/bzip2/bzip2.gyp:bzip2', + '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg', + '<(DEPTH)/third_party/icu/icu.gyp:icui18n', + '<(DEPTH)/third_party/icu/icu.gyp:icuuc', + '<(DEPTH)/third_party/leveldatabase/leveldatabase.gyp:leveldatabase', + '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', + '<(DEPTH)/third_party/libpng/libpng.gyp:libpng', + '<(DEPTH)/third_party/libxml/libxml.gyp:libxml', + '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt', + '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64', + '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', + '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', + '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', + '<(DEPTH)/ui/ui.gyp:gfx_resources', + '<(DEPTH)/ui/ui.gyp:ui', + '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', + '<(DEPTH)/webkit/support/webkit_support.gyp:appcache', + '<(DEPTH)/webkit/support/webkit_support.gyp:blob', + '<(DEPTH)/webkit/support/webkit_support.gyp:database', + '<(DEPTH)/webkit/support/webkit_support.gyp:fileapi', + '<(DEPTH)/webkit/support/webkit_support.gyp:glue', + '<(DEPTH)/webkit/support/webkit_support.gyp:quota', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_gpu', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_media', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_user_agent', 'libcef_static', ], 'defines': [ @@ -474,7 +475,6 @@ ], 'include_dirs': [ '.', - '..', ], # Avoid "RC1102: internal error : too many arguments to RCPP" error by # explicitly specifying a short list of resource include directories. @@ -498,10 +498,10 @@ 'conditions': [ ['OS=="win"', { 'dependencies': [ - '../breakpad/breakpad.gyp:breakpad_handler', - '../third_party/angle/src/build_angle.gyp:libEGL', - '../third_party/angle/src/build_angle.gyp:libGLESv2', - '../ui/views/views.gyp:views', + '<(DEPTH)/breakpad/breakpad.gyp:breakpad_handler', + '<(DEPTH)/third_party/angle/src/build_angle.gyp:libEGL', + '<(DEPTH)/third_party/angle/src/build_angle.gyp:libGLESv2', + '<(DEPTH)/ui/views/views.gyp:views', ], 'sources': [ '<@(includes_win)', @@ -523,7 +523,7 @@ }], [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'dependencies':[ - '../base/allocator/allocator.gyp:allocator', + '<(DEPTH)/base/allocator/allocator.gyp:allocator', ], 'direct_dependent_settings': { 'cflags': [ @@ -546,7 +546,7 @@ 'type': 'static_library', 'msvs_guid': 'A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9', 'dependencies': [ - '../third_party/npapi/npapi.gyp:npapi', + '<(DEPTH)/third_party/npapi/npapi.gyp:npapi', 'libcef', ], 'defines': [ @@ -554,7 +554,6 @@ ], 'include_dirs': [ '.', - '..', ], 'sources': [ '<@(includes_common)', @@ -567,7 +566,7 @@ 'target_name': 'cef_extra_resources', 'type': 'none', 'dependencies': [ - '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:generate_devtools_grd', + '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:generate_devtools_grd', ], # These resources end up in chrome.pak because they are resources # used by internal pages. Putting them in a spearate pak file makes @@ -611,48 +610,47 @@ ], 'include_dirs': [ '.', - '..', - '../third_party/WebKit/Source/WebKit/chromium/public', + '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/public', '<(grit_out_dir)', ], 'dependencies': [ 'cef_extra_resources', - '../base/base.gyp:base', - '../base/base.gyp:base_i18n', - '../build/temp_gyp/googleurl.gyp:googleurl', - '../media/media.gyp:media', - '../net/net.gyp:net', - '../net/net.gyp:net_resources', - '../printing/printing.gyp:printing', - '../sdch/sdch.gyp:sdch', - '../skia/skia.gyp:skia', - '../third_party/bzip2/bzip2.gyp:bzip2', - '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg', - '../third_party/icu/icu.gyp:icui18n', - '../third_party/icu/icu.gyp:icuuc', - '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', - '../third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', - '../third_party/libpng/libpng.gyp:libpng', - '../third_party/libxml/libxml.gyp:libxml', - '../third_party/libxslt/libxslt.gyp:libxslt', - '../third_party/modp_b64/modp_b64.gyp:modp_b64', - '../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', - '../third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', - '../third_party/zlib/zlib.gyp:zlib', - '../ui/ui.gyp:gfx_resources', - '../ui/ui.gyp:ui', - '../v8/tools/gyp/v8.gyp:v8', - '../webkit/support/webkit_support.gyp:appcache', - '../webkit/support/webkit_support.gyp:blob', - '../webkit/support/webkit_support.gyp:database', - '../webkit/support/webkit_support.gyp:fileapi', - '../webkit/support/webkit_support.gyp:glue', - '../webkit/support/webkit_support.gyp:quota', - '../webkit/support/webkit_support.gyp:webkit_gpu', - '../webkit/support/webkit_support.gyp:webkit_media', - '../webkit/support/webkit_support.gyp:webkit_resources', - '../webkit/support/webkit_support.gyp:webkit_strings', - '../webkit/support/webkit_support.gyp:webkit_user_agent', + '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/base/base.gyp:base_i18n', + '<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl', + '<(DEPTH)/media/media.gyp:media', + '<(DEPTH)/net/net.gyp:net', + '<(DEPTH)/net/net.gyp:net_resources', + '<(DEPTH)/printing/printing.gyp:printing', + '<(DEPTH)/sdch/sdch.gyp:sdch', + '<(DEPTH)/skia/skia.gyp:skia', + '<(DEPTH)/third_party/bzip2/bzip2.gyp:bzip2', + '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg', + '<(DEPTH)/third_party/icu/icu.gyp:icui18n', + '<(DEPTH)/third_party/icu/icu.gyp:icuuc', + '<(DEPTH)/third_party/leveldatabase/leveldatabase.gyp:leveldatabase', + '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', + '<(DEPTH)/third_party/libpng/libpng.gyp:libpng', + '<(DEPTH)/third_party/libxml/libxml.gyp:libxml', + '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt', + '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64', + '<(DEPTH)/third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', + '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit', + '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', + '<(DEPTH)/ui/ui.gyp:gfx_resources', + '<(DEPTH)/ui/ui.gyp:ui', + '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', + '<(DEPTH)/webkit/support/webkit_support.gyp:appcache', + '<(DEPTH)/webkit/support/webkit_support.gyp:blob', + '<(DEPTH)/webkit/support/webkit_support.gyp:database', + '<(DEPTH)/webkit/support/webkit_support.gyp:fileapi', + '<(DEPTH)/webkit/support/webkit_support.gyp:glue', + '<(DEPTH)/webkit/support/webkit_support.gyp:quota', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_gpu', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_media', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings', + '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_user_agent', ], 'sources': [ '<@(includes_common)', @@ -779,10 +777,10 @@ 'conditions': [ ['OS=="win"', { 'dependencies': [ - '../breakpad/breakpad.gyp:breakpad_handler', - '../third_party/angle/src/build_angle.gyp:libEGL', - '../third_party/angle/src/build_angle.gyp:libGLESv2', - '../ui/views/views.gyp:views', + '<(DEPTH)/breakpad/breakpad.gyp:breakpad_handler', + '<(DEPTH)/third_party/angle/src/build_angle.gyp:libEGL', + '<(DEPTH)/third_party/angle/src/build_angle.gyp:libGLESv2', + '<(DEPTH)/ui/views/views.gyp:views', ], 'sources': [ '<@(includes_win)', @@ -828,12 +826,12 @@ 'libcef/web_drop_target_mac.h', 'libcef/web_drop_target_mac.mm', # Build necessary Mozilla sources - '../third_party/mozilla/NSPasteboard+Utils.h', - '../third_party/mozilla/NSPasteboard+Utils.mm', - '../third_party/mozilla/NSString+Utils.h', - '../third_party/mozilla/NSString+Utils.mm', - '../third_party/mozilla/NSURL+Utils.h', - '../third_party/mozilla/NSURL+Utils.m', + '<(DEPTH)/third_party/mozilla/NSPasteboard+Utils.h', + '<(DEPTH)/third_party/mozilla/NSPasteboard+Utils.mm', + '<(DEPTH)/third_party/mozilla/NSString+Utils.h', + '<(DEPTH)/third_party/mozilla/NSString+Utils.mm', + '<(DEPTH)/third_party/mozilla/NSURL+Utils.h', + '<(DEPTH)/third_party/mozilla/NSURL+Utils.m', ], }], [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { diff --git a/include/capi/cef_app_capi.h b/include/capi/cef_app_capi.h index 743b7f5ad..bc64b5ba3 100644 --- a/include/capi/cef_app_capi.h +++ b/include/capi/cef_app_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_APP_CAPI_H -#define _CEF_APP_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -89,8 +90,7 @@ CEF_EXPORT void cef_quit_message_loop(); /// // Implement this structure to provide handler implementations. /// -typedef struct _cef_app_t -{ +typedef struct _cef_app_t { /// // Base structure. /// @@ -102,7 +102,6 @@ typedef struct _cef_app_t /// struct _cef_proxy_handler_t* (CEF_CALLBACK *get_proxy_handler)( struct _cef_app_t* self); - } cef_app_t; @@ -110,4 +109,4 @@ typedef struct _cef_app_t } #endif -#endif // _CEF_APP_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ diff --git a/include/capi/cef_base_capi.h b/include/capi/cef_base_capi.h index 6834ed655..0323520c5 100644 --- a/include/capi/cef_base_capi.h +++ b/include/capi/cef_base_capi.h @@ -28,26 +28,25 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef _CEF_BASE_CAPI_H -#define _CEF_BASE_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ #ifdef __cplusplus extern "C" { #endif -#include "../internal/cef_export.h" -#include "../internal/cef_string.h" -#include "../internal/cef_string_list.h" -#include "../internal/cef_string_map.h" -#include "../internal/cef_string_multimap.h" -#include "../internal/cef_types.h" +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_string_map.h" +#include "include/internal/cef_string_multimap.h" +#include "include/internal/cef_types.h" /// // Structure defining the reference count implementation functions. All // framework structures must include the cef_base_t structure first. /// -typedef struct _cef_base_t -{ +typedef struct _cef_base_t { /// // Size of the data structure. /// @@ -68,7 +67,6 @@ typedef struct _cef_base_t // Returns the current number of references. /// int (CEF_CALLBACK *get_refct)(struct _cef_base_t* self); - } cef_base_t; @@ -84,4 +82,4 @@ typedef struct _cef_base_t } #endif -#endif // _CEF_BASE_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ diff --git a/include/capi/cef_browser_capi.h b/include/capi/cef_browser_capi.h index 80dc7efd4..60f8f4789 100644 --- a/include/capi/cef_browser_capi.h +++ b/include/capi/cef_browser_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_BROWSER_CAPI_H -#define _CEF_BROWSER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure used to represent a browser window. The functions of this structure // may be called on any thread unless otherwise indicated in the comments. /// -typedef struct _cef_browser_t -{ +typedef struct _cef_browser_t { /// // Base structure. /// @@ -294,7 +294,6 @@ typedef struct _cef_browser_t // Send a capture lost event to the browser. /// void (CEF_CALLBACK *send_capture_lost_event)(struct _cef_browser_t* self); - } cef_browser_t; @@ -320,4 +319,4 @@ CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, } #endif -#endif // _CEF_BROWSER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ diff --git a/include/capi/cef_client_capi.h b/include/capi/cef_client_capi.h index ac5f1f382..639acdae9 100644 --- a/include/capi/cef_client_capi.h +++ b/include/capi/cef_client_capi.h @@ -34,21 +34,21 @@ // more information. // -#ifndef _CEF_CLIENT_CAPI_H -#define _CEF_CLIENT_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to provide handler implementations. /// -typedef struct _cef_client_t -{ +typedef struct _cef_client_t { /// // Base structure. /// @@ -137,7 +137,6 @@ typedef struct _cef_client_t /// struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)( struct _cef_client_t* self); - } cef_client_t; @@ -145,4 +144,4 @@ typedef struct _cef_client_t } #endif -#endif // _CEF_CLIENT_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ diff --git a/include/capi/cef_command_line_capi.h b/include/capi/cef_command_line_capi.h index 65a76a5e0..a5a5ea9fc 100644 --- a/include/capi/cef_command_line_capi.h +++ b/include/capi/cef_command_line_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_COMMAND_LINE_CAPI_H -#define _CEF_COMMAND_LINE_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -54,8 +55,7 @@ extern "C" { // arguments. Switch names are considered case-insensitive. This structure can // be used before cef_initialize() is called. /// -typedef struct _cef_command_line_t -{ +typedef struct _cef_command_line_t { /// // Base structure. /// @@ -153,7 +153,6 @@ typedef struct _cef_command_line_t /// void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self, const cef_string_t* argument); - } cef_command_line_t; @@ -167,4 +166,4 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create(); } #endif -#endif // _CEF_COMMAND_LINE_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ diff --git a/include/capi/cef_content_filter_capi.h b/include/capi/cef_content_filter_capi.h index 1bdf2e6c3..e9ed878a4 100644 --- a/include/capi/cef_content_filter_capi.h +++ b/include/capi/cef_content_filter_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_CONTENT_FILTER_CAPI_H -#define _CEF_CONTENT_FILTER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_CONTENT_FILTER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CONTENT_FILTER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure to implement for filtering response content. The functions of this // structure will always be called on the UI thread. /// -typedef struct _cef_content_filter_t -{ +typedef struct _cef_content_filter_t { /// // Base structure. /// @@ -70,7 +70,6 @@ typedef struct _cef_content_filter_t /// void (CEF_CALLBACK *drain)(struct _cef_content_filter_t* self, struct _cef_stream_reader_t** remainder); - } cef_content_filter_t; @@ -78,4 +77,4 @@ typedef struct _cef_content_filter_t } #endif -#endif // _CEF_CONTENT_FILTER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_CONTENT_FILTER_CAPI_H_ diff --git a/include/capi/cef_cookie_capi.h b/include/capi/cef_cookie_capi.h index 4c7d5aaee..cf5dd535c 100644 --- a/include/capi/cef_cookie_capi.h +++ b/include/capi/cef_cookie_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_COOKIE_CAPI_H -#define _CEF_COOKIE_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -93,8 +94,7 @@ CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path); // Structure to implement for visiting cookie values. The functions of this // structure will always be called on the IO thread. /// -typedef struct _cef_cookie_visitor_t -{ +typedef struct _cef_cookie_visitor_t { /// // Base structure. /// @@ -110,7 +110,6 @@ typedef struct _cef_cookie_visitor_t int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self, const struct _cef_cookie_t* cookie, int count, int total, int* deleteCookie); - } cef_cookie_visitor_t; @@ -118,4 +117,4 @@ typedef struct _cef_cookie_visitor_t } #endif -#endif // _CEF_COOKIE_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ diff --git a/include/capi/cef_display_handler_capi.h b/include/capi/cef_display_handler_capi.h index 33c464878..5f2ea0fb9 100644 --- a/include/capi/cef_display_handler_capi.h +++ b/include/capi/cef_display_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_DISPLAY_HANDLER_CAPI_H -#define _CEF_DISPLAY_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to browser display state. // The functions of this structure will be called on the UI thread. /// -typedef struct _cef_display_handler_t -{ +typedef struct _cef_display_handler_t { /// // Base structure. /// @@ -107,7 +107,6 @@ typedef struct _cef_display_handler_t int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self, struct _cef_browser_t* browser, const cef_string_t* message, const cef_string_t* source, int line); - } cef_display_handler_t; @@ -115,4 +114,4 @@ typedef struct _cef_display_handler_t } #endif -#endif // _CEF_DISPLAY_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ diff --git a/include/capi/cef_dom_capi.h b/include/capi/cef_dom_capi.h index 4aad95450..1807ea203 100644 --- a/include/capi/cef_dom_capi.h +++ b/include/capi/cef_dom_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_DOM_CAPI_H -#define _CEF_DOM_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure to implement for visiting the DOM. The functions of this structure // will be called on the UI thread. /// -typedef struct _cef_domvisitor_t -{ +typedef struct _cef_domvisitor_t { /// // Base structure. /// @@ -64,7 +64,6 @@ typedef struct _cef_domvisitor_t /// void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self, struct _cef_domdocument_t* document); - } cef_domvisitor_t; @@ -72,8 +71,7 @@ typedef struct _cef_domvisitor_t // Structure used to represent a DOM document. The functions of this structure // should only be called on the UI thread. /// -typedef struct _cef_domdocument_t -{ +typedef struct _cef_domdocument_t { /// // Base structure. /// @@ -178,7 +176,6 @@ typedef struct _cef_domdocument_t // The resulting string must be freed by calling cef_string_userfree_free(). cef_string_userfree_t (CEF_CALLBACK *get_complete_url)( struct _cef_domdocument_t* self, const cef_string_t* partialURL); - } cef_domdocument_t; @@ -186,8 +183,7 @@ typedef struct _cef_domdocument_t // Structure used to represent a DOM node. The functions of this structure // should only be called on the UI thread. /// -typedef struct _cef_domnode_t -{ +typedef struct _cef_domnode_t { /// // Base structure. /// @@ -355,7 +351,6 @@ typedef struct _cef_domnode_t // The resulting string must be freed by calling cef_string_userfree_free(). cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)( struct _cef_domnode_t* self); - } cef_domnode_t; @@ -363,8 +358,7 @@ typedef struct _cef_domnode_t // Structure used to represent a DOM event. The functions of this structure // should only be called on the UI thread. /// -typedef struct _cef_domevent_t -{ +typedef struct _cef_domevent_t { /// // Base structure. /// @@ -415,7 +409,6 @@ typedef struct _cef_domevent_t /// struct _cef_domnode_t* (CEF_CALLBACK *get_current_target)( struct _cef_domevent_t* self); - } cef_domevent_t; @@ -423,8 +416,7 @@ typedef struct _cef_domevent_t // Structure to implement for handling DOM events. The functions of this // structure will be called on the UI thread. /// -typedef struct _cef_domevent_listener_t -{ +typedef struct _cef_domevent_listener_t { /// // Base structure. /// @@ -439,7 +431,6 @@ typedef struct _cef_domevent_listener_t /// void (CEF_CALLBACK *handle_event)(struct _cef_domevent_listener_t* self, struct _cef_domevent_t* event); - } cef_domevent_listener_t; @@ -447,4 +438,4 @@ typedef struct _cef_domevent_listener_t } #endif -#endif // _CEF_DOM_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ diff --git a/include/capi/cef_download_handler_capi.h b/include/capi/cef_download_handler_capi.h index 57e08cabb..50f1f4bd1 100644 --- a/include/capi/cef_download_handler_capi.h +++ b/include/capi/cef_download_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_DOWNLOAD_HANDLER_CAPI_H -#define _CEF_DOWNLOAD_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure used to handle file downloads. The functions of this structure will // always be called on the UI thread. /// -typedef struct _cef_download_handler_t -{ +typedef struct _cef_download_handler_t { /// // Base structure. /// @@ -67,7 +67,6 @@ typedef struct _cef_download_handler_t // The download is complete. /// void (CEF_CALLBACK *complete)(struct _cef_download_handler_t* self); - } cef_download_handler_t; @@ -75,4 +74,4 @@ typedef struct _cef_download_handler_t } #endif -#endif // _CEF_DOWNLOAD_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ diff --git a/include/capi/cef_drag_data_capi.h b/include/capi/cef_drag_data_capi.h index e191b5227..f2fff0d97 100644 --- a/include/capi/cef_drag_data_capi.h +++ b/include/capi/cef_drag_data_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_DRAG_DATA_CAPI_H -#define _CEF_DRAG_DATA_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure used to represent drag data. The functions of this structure may be // called on any thread. /// -typedef struct _cef_drag_data_t -{ +typedef struct _cef_drag_data_t { /// // Base structure. /// @@ -133,7 +133,6 @@ typedef struct _cef_drag_data_t /// int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, cef_string_list_t names); - } cef_drag_data_t; @@ -141,4 +140,4 @@ typedef struct _cef_drag_data_t } #endif -#endif // _CEF_DRAG_DATA_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ diff --git a/include/capi/cef_drag_handler_capi.h b/include/capi/cef_drag_handler_capi.h index 34f11eded..8e74f3586 100644 --- a/include/capi/cef_drag_handler_capi.h +++ b/include/capi/cef_drag_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_DRAG_HANDLER_CAPI_H -#define _CEF_DRAG_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to dragging. The functions // of this structure will be called on the UI thread. /// -typedef struct _cef_drag_handler_t -{ +typedef struct _cef_drag_handler_t { /// // Base structure. /// @@ -74,7 +74,6 @@ typedef struct _cef_drag_handler_t int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, enum cef_drag_operations_mask_t mask); - } cef_drag_handler_t; @@ -82,4 +81,4 @@ typedef struct _cef_drag_handler_t } #endif -#endif // _CEF_DRAG_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ diff --git a/include/capi/cef_find_handler_capi.h b/include/capi/cef_find_handler_capi.h index 3439c5920..b729bd1e3 100644 --- a/include/capi/cef_find_handler_capi.h +++ b/include/capi/cef_find_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_FIND_HANDLER_CAPI_H -#define _CEF_FIND_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to find results. The // functions of this structure will be called on the UI thread. /// -typedef struct _cef_find_handler_t -{ +typedef struct _cef_find_handler_t { /// // Base structure. /// @@ -67,7 +67,6 @@ typedef struct _cef_find_handler_t struct _cef_browser_t* browser, int identifier, int count, const cef_rect_t* selectionRect, int activeMatchOrdinal, int finalUpdate); - } cef_find_handler_t; @@ -75,4 +74,4 @@ typedef struct _cef_find_handler_t } #endif -#endif // _CEF_FIND_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_ diff --git a/include/capi/cef_focus_handler_capi.h b/include/capi/cef_focus_handler_capi.h index b9f869218..17de32c64 100644 --- a/include/capi/cef_focus_handler_capi.h +++ b/include/capi/cef_focus_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_FOCUS_HANDLER_CAPI_H -#define _CEF_FOCUS_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to focus. The functions of // this structure will be called on the UI thread. /// -typedef struct _cef_focus_handler_t -{ +typedef struct _cef_focus_handler_t { /// // Base structure. /// @@ -83,7 +83,6 @@ typedef struct _cef_focus_handler_t void (CEF_CALLBACK *on_focused_node_changed)( struct _cef_focus_handler_t* self, struct _cef_browser_t* browser, struct _cef_frame_t* frame, struct _cef_domnode_t* node); - } cef_focus_handler_t; @@ -91,4 +90,4 @@ typedef struct _cef_focus_handler_t } #endif -#endif // _CEF_FOCUS_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ diff --git a/include/capi/cef_frame_capi.h b/include/capi/cef_frame_capi.h index 07c18ba4e..763cb9a74 100644 --- a/include/capi/cef_frame_capi.h +++ b/include/capi/cef_frame_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_FRAME_CAPI_H -#define _CEF_FRAME_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -49,8 +50,7 @@ extern "C" { // this structure may be called on any thread unless otherwise indicated in the // comments. /// -typedef struct _cef_frame_t -{ +typedef struct _cef_frame_t { /// // Base structure. /// @@ -130,10 +130,10 @@ typedef struct _cef_frame_t const cef_string_t* url); /// - // Load the contents of |string| with the optional dummy target |url|. + // Load the contents of |string_val| with the optional dummy target |url|. /// void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self, - const cef_string_t* string, const cef_string_t* url); + const cef_string_t* string_val, const cef_string_t* url); /// // Load the contents of |stream| with the optional dummy target |url|. @@ -177,7 +177,7 @@ typedef struct _cef_frame_t // Returns the globally unique identifier for this frame. This function should // only be called on the UI thread. /// - long long (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self); + int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self); /// // Returns the parent of this frame or NULL if this is the main (top-level) @@ -209,7 +209,6 @@ typedef struct _cef_frame_t /// struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)( struct _cef_frame_t* self); - } cef_frame_t; @@ -217,4 +216,4 @@ typedef struct _cef_frame_t } #endif -#endif // _CEF_FRAME_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ diff --git a/include/capi/cef_jsdialog_handler_capi.h b/include/capi/cef_jsdialog_handler_capi.h index 3c65e4ce7..36ed63ef4 100644 --- a/include/capi/cef_jsdialog_handler_capi.h +++ b/include/capi/cef_jsdialog_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_JSDIALOG_HANDLER_CAPI_H -#define _CEF_JSDIALOG_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to JavaScript dialogs. The // functions of this structure will be called on the UI thread. /// -typedef struct _cef_jsdialog_handler_t -{ +typedef struct _cef_jsdialog_handler_t { /// // Base structure. /// @@ -82,7 +82,6 @@ typedef struct _cef_jsdialog_handler_t struct _cef_browser_t* browser, struct _cef_frame_t* frame, const cef_string_t* message, const cef_string_t* defaultValue, int* retval, cef_string_t* result); - } cef_jsdialog_handler_t; @@ -90,4 +89,4 @@ typedef struct _cef_jsdialog_handler_t } #endif -#endif // _CEF_JSDIALOG_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ diff --git a/include/capi/cef_keyboard_handler_capi.h b/include/capi/cef_keyboard_handler_capi.h index 52087b393..ff96b3312 100644 --- a/include/capi/cef_keyboard_handler_capi.h +++ b/include/capi/cef_keyboard_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_KEYBOARD_HANDLER_CAPI_H -#define _CEF_KEYBOARD_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to keyboard input. The // functions of this structure will be called on the UI thread. /// -typedef struct _cef_keyboard_handler_t -{ +typedef struct _cef_keyboard_handler_t { /// // Base structure. /// @@ -72,7 +72,6 @@ typedef struct _cef_keyboard_handler_t int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, struct _cef_browser_t* browser, enum cef_handler_keyevent_type_t type, int code, int modifiers, int isSystemKey, int isAfterJavaScript); - } cef_keyboard_handler_t; @@ -80,4 +79,4 @@ typedef struct _cef_keyboard_handler_t } #endif -#endif // _CEF_KEYBOARD_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ diff --git a/include/capi/cef_life_span_handler_capi.h b/include/capi/cef_life_span_handler_capi.h index b3a10e231..be5fe1290 100644 --- a/include/capi/cef_life_span_handler_capi.h +++ b/include/capi/cef_life_span_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_LIFE_SPAN_HANDLER_CAPI_H -#define _CEF_LIFE_SPAN_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to browser life span. The // functions of this structure will be called on the UI thread. /// -typedef struct _cef_life_span_handler_t -{ +typedef struct _cef_life_span_handler_t { /// // Base structure. /// @@ -104,7 +104,6 @@ typedef struct _cef_life_span_handler_t /// void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self, struct _cef_browser_t* browser); - } cef_life_span_handler_t; @@ -112,4 +111,4 @@ typedef struct _cef_life_span_handler_t } #endif -#endif // _CEF_LIFE_SPAN_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ diff --git a/include/capi/cef_load_handler_capi.h b/include/capi/cef_load_handler_capi.h index 356a3b34c..baea13038 100644 --- a/include/capi/cef_load_handler_capi.h +++ b/include/capi/cef_load_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_LOAD_HANDLER_CAPI_H -#define _CEF_LOAD_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to browser load status. The // functions of this structure will be called on the UI thread. /// -typedef struct _cef_load_handler_t -{ +typedef struct _cef_load_handler_t { /// // Base structure. /// @@ -89,7 +89,6 @@ typedef struct _cef_load_handler_t struct _cef_browser_t* browser, struct _cef_frame_t* frame, enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl, cef_string_t* errorText); - } cef_load_handler_t; @@ -97,4 +96,4 @@ typedef struct _cef_load_handler_t } #endif -#endif // _CEF_LOAD_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ diff --git a/include/capi/cef_menu_handler_capi.h b/include/capi/cef_menu_handler_capi.h index 41ab1ffe4..7cf2b9ad8 100644 --- a/include/capi/cef_menu_handler_capi.h +++ b/include/capi/cef_menu_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_MENU_HANDLER_CAPI_H -#define _CEF_MENU_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_MENU_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_MENU_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to browser context menus. // The functions of this structure will be called on the UI thread. /// -typedef struct _cef_menu_handler_t -{ +typedef struct _cef_menu_handler_t { /// // Base structure. /// @@ -78,7 +78,6 @@ typedef struct _cef_menu_handler_t /// int (CEF_CALLBACK *on_menu_action)(struct _cef_menu_handler_t* self, struct _cef_browser_t* browser, enum cef_menu_id_t menuId); - } cef_menu_handler_t; @@ -86,4 +85,4 @@ typedef struct _cef_menu_handler_t } #endif -#endif // _CEF_MENU_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_MENU_HANDLER_CAPI_H_ diff --git a/include/capi/cef_nplugin_capi.h b/include/capi/cef_nplugin_capi.h index 2d595a1ed..d6adf1bf0 100644 --- a/include/capi/cef_nplugin_capi.h +++ b/include/capi/cef_nplugin_capi.h @@ -28,14 +28,14 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef _CEF_NPLUGIN_CAPI_H -#define _CEF_NPLUGIN_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_NPLUGIN_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_NPLUGIN_CAPI_H_ #ifdef __cplusplus extern "C" { #endif -#include "../internal/cef_nplugin_types.h" +#include "include/internal/cef_nplugin_types.h" /// // Register a plugin with the system. Returns true (1) on success. @@ -46,4 +46,4 @@ CEF_EXPORT int cef_register_plugin(const cef_plugin_info_t* plugin_info); } #endif -#endif // _CEF_NPLUGIN_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_NPLUGIN_CAPI_H_ diff --git a/include/capi/cef_origin_whitelist_capi.h b/include/capi/cef_origin_whitelist_capi.h index 3bf69ff3a..e6fb2d1ac 100644 --- a/include/capi/cef_origin_whitelist_capi.h +++ b/include/capi/cef_origin_whitelist_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_ORIGIN_WHITELIST_CAPI_H -#define _CEF_ORIGIN_WHITELIST_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -98,4 +99,4 @@ CEF_EXPORT int cef_clear_cross_origin_whitelist(); } #endif -#endif // _CEF_ORIGIN_WHITELIST_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ diff --git a/include/capi/cef_permission_handler_capi.h b/include/capi/cef_permission_handler_capi.h index e3f94d173..13db70eb9 100644 --- a/include/capi/cef_permission_handler_capi.h +++ b/include/capi/cef_permission_handler_capi.h @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_PERMISSION_HANDLER_CAPI_H -#define _CEF_PERMISSION_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to browser permissions. The // functions of this structure will be called on the UI thread. /// -typedef struct _cef_permission_handler_t -{ +typedef struct _cef_permission_handler_t { /// // Base structure. /// @@ -57,12 +57,11 @@ typedef struct _cef_permission_handler_t /// // Called on the UI thread before a script extension is loaded. Return false - // (0) to prevent the extension from loading. + // (0) to let the extension load normally. /// int (CEF_CALLBACK *on_before_script_extension_load)( struct _cef_permission_handler_t* self, struct _cef_browser_t* browser, struct _cef_frame_t* frame, const cef_string_t* extensionName); - } cef_permission_handler_t; @@ -70,4 +69,4 @@ typedef struct _cef_permission_handler_t } #endif -#endif // _CEF_PERMISSION_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_PERMISSION_HANDLER_CAPI_H_ diff --git a/include/capi/cef_print_handler_capi.h b/include/capi/cef_print_handler_capi.h index ce9eef45a..be5cfc78e 100644 --- a/include/capi/cef_print_handler_capi.h +++ b/include/capi/cef_print_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_PRINT_HANDLER_CAPI_H -#define _CEF_PRINT_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to printing. The functions // of this structure will be called on the UI thread. /// -typedef struct _cef_print_handler_t -{ +typedef struct _cef_print_handler_t { /// // Base structure. /// @@ -86,7 +86,6 @@ typedef struct _cef_print_handler_t cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight, cef_string_t* bottomLeft, cef_string_t* bottomCenter, cef_string_t* bottomRight); - } cef_print_handler_t; @@ -94,4 +93,4 @@ typedef struct _cef_print_handler_t } #endif -#endif // _CEF_PRINT_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ diff --git a/include/capi/cef_proxy_handler_capi.h b/include/capi/cef_proxy_handler_capi.h index 1ae86952f..2628002d6 100644 --- a/include/capi/cef_proxy_handler_capi.h +++ b/include/capi/cef_proxy_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,21 +34,21 @@ // more information. // -#ifndef _CEF_PROXY_HANDLER_CAPI_H -#define _CEF_PROXY_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle proxy resolution events. /// -typedef struct _cef_proxy_handler_t -{ +typedef struct _cef_proxy_handler_t { /// // Base structure. /// @@ -59,7 +59,6 @@ typedef struct _cef_proxy_handler_t /// void (CEF_CALLBACK *get_proxy_for_url)(struct _cef_proxy_handler_t* self, const cef_string_t* url, struct _cef_proxy_info_t* proxy_info); - } cef_proxy_handler_t; @@ -67,4 +66,4 @@ typedef struct _cef_proxy_handler_t } #endif -#endif // _CEF_PROXY_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_PROXY_HANDLER_CAPI_H_ diff --git a/include/capi/cef_render_handler_capi.h b/include/capi/cef_render_handler_capi.h index 65d71ca7b..53fc5d8e5 100644 --- a/include/capi/cef_render_handler_capi.h +++ b/include/capi/cef_render_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_RENDER_HANDLER_CAPI_H -#define _CEF_RENDER_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events when window rendering is disabled. // The functions of this structure will be called on the UI thread. /// -typedef struct _cef_render_handler_t -{ +typedef struct _cef_render_handler_t { /// // Base structure. /// @@ -108,7 +108,6 @@ typedef struct _cef_render_handler_t /// void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self, struct _cef_browser_t* browser, cef_cursor_handle_t cursor); - } cef_render_handler_t; @@ -116,4 +115,4 @@ typedef struct _cef_render_handler_t } #endif -#endif // _CEF_RENDER_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ diff --git a/include/capi/cef_request_capi.h b/include/capi/cef_request_capi.h index 5c56418fc..f4650f6ec 100644 --- a/include/capi/cef_request_capi.h +++ b/include/capi/cef_request_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_REQUEST_CAPI_H -#define _CEF_REQUEST_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure used to represent a web request. The functions of this structure // may be called on any thread. /// -typedef struct _cef_request_t -{ +typedef struct _cef_request_t { /// // Base structure. /// @@ -137,7 +137,6 @@ typedef struct _cef_request_t /// void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self, const cef_string_t* url); - } cef_request_t; @@ -151,8 +150,7 @@ CEF_EXPORT cef_request_t* cef_request_create(); // Structure used to represent post data for a web request. The functions of // this structure may be called on any thread. /// -typedef struct _cef_post_data_t -{ +typedef struct _cef_post_data_t { /// // Base structure. /// @@ -186,7 +184,6 @@ typedef struct _cef_post_data_t // Remove all existing post data elements. /// void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self); - } cef_post_data_t; @@ -200,8 +197,7 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create(); // Structure used to represent a single element in the request post data. The // functions of this structure may be called on any thread. /// -typedef struct _cef_post_data_element_t -{ +typedef struct _cef_post_data_element_t { /// // Base structure. /// @@ -249,7 +245,6 @@ typedef struct _cef_post_data_element_t /// size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self, size_t size, void* bytes); - } cef_post_data_element_t; @@ -263,4 +258,4 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(); } #endif -#endif // _CEF_REQUEST_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ diff --git a/include/capi/cef_request_handler_capi.h b/include/capi/cef_request_handler_capi.h index 88dcb76e7..3fe0ab48f 100644 --- a/include/capi/cef_request_handler_capi.h +++ b/include/capi/cef_request_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_REQUEST_HANDLER_CAPI_H -#define _CEF_REQUEST_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle events related to browser requests. The // functions of this structure will be called on the thread indicated. /// -typedef struct _cef_request_handler_t -{ +typedef struct _cef_request_handler_t { /// // Base structure. /// @@ -139,7 +139,6 @@ typedef struct _cef_request_handler_t struct _cef_browser_t* browser, int isProxy, const cef_string_t* host, int port, const cef_string_t* realm, const cef_string_t* scheme, cef_string_t* username, cef_string_t* password); - } cef_request_handler_t; @@ -147,4 +146,4 @@ typedef struct _cef_request_handler_t } #endif -#endif // _CEF_REQUEST_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ diff --git a/include/capi/cef_response_capi.h b/include/capi/cef_response_capi.h index 6881c26a3..e58180711 100644 --- a/include/capi/cef_response_capi.h +++ b/include/capi/cef_response_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_RESPONSE_CAPI_H -#define _CEF_RESPONSE_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure used to represent a web response. The functions of this structure // may be called on any thread. /// -typedef struct _cef_response_t -{ +typedef struct _cef_response_t { /// // Base structure. /// @@ -109,7 +109,6 @@ typedef struct _cef_response_t /// void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self, cef_string_multimap_t headerMap); - } cef_response_t; @@ -117,4 +116,4 @@ typedef struct _cef_response_t } #endif -#endif // _CEF_RESPONSE_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ diff --git a/include/capi/cef_scheme_capi.h b/include/capi/cef_scheme_capi.h index 7610a48e2..039efa8df 100644 --- a/include/capi/cef_scheme_capi.h +++ b/include/capi/cef_scheme_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_SCHEME_CAPI_H -#define _CEF_SCHEME_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -117,8 +118,7 @@ CEF_EXPORT int cef_clear_scheme_handler_factories(); // Structure that creates cef_scheme_handler_t instances. The functions of this // structure will always be called on the IO thread. /// -typedef struct _cef_scheme_handler_factory_t -{ +typedef struct _cef_scheme_handler_factory_t { /// // Base structure. /// @@ -133,7 +133,6 @@ typedef struct _cef_scheme_handler_factory_t struct _cef_scheme_handler_factory_t* self, struct _cef_browser_t* browser, const cef_string_t* scheme_name, struct _cef_request_t* request); - } cef_scheme_handler_factory_t; @@ -141,8 +140,7 @@ typedef struct _cef_scheme_handler_factory_t // Structure used to facilitate asynchronous responses to custom scheme handler // requests. The functions of this structure may be called on any thread. /// -typedef struct _cef_scheme_handler_callback_t -{ +typedef struct _cef_scheme_handler_callback_t { /// // Base structure. /// @@ -164,7 +162,6 @@ typedef struct _cef_scheme_handler_callback_t // Cancel processing of the request. /// void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_callback_t* self); - } cef_scheme_handler_callback_t; @@ -172,8 +169,7 @@ typedef struct _cef_scheme_handler_callback_t // Structure used to implement a custom scheme handler structure. The functions // of this structure will always be called on the IO thread. /// -typedef struct _cef_scheme_handler_t -{ +typedef struct _cef_scheme_handler_t { /// // Base structure. /// @@ -219,7 +215,6 @@ typedef struct _cef_scheme_handler_t // Request processing has been canceled. /// void (CEF_CALLBACK *cancel)(struct _cef_scheme_handler_t* self); - } cef_scheme_handler_t; @@ -227,4 +222,4 @@ typedef struct _cef_scheme_handler_t } #endif -#endif // _CEF_SCHEME_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ diff --git a/include/capi/cef_storage_capi.h b/include/capi/cef_storage_capi.h index 1f861d4a5..d04a6684b 100644 --- a/include/capi/cef_storage_capi.h +++ b/include/capi/cef_storage_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_STORAGE_CAPI_H -#define _CEF_STORAGE_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_STORAGE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_STORAGE_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -88,8 +89,7 @@ CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, // Structure to implement for visiting storage. The functions of this structure // will always be called on the UI thread. /// -typedef struct _cef_storage_visitor_t -{ +typedef struct _cef_storage_visitor_t { /// // Base structure. /// @@ -106,7 +106,6 @@ typedef struct _cef_storage_visitor_t enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key, const cef_string_t* value, int count, int total, int* deleteData); - } cef_storage_visitor_t; @@ -114,4 +113,4 @@ typedef struct _cef_storage_visitor_t } #endif -#endif // _CEF_STORAGE_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_STORAGE_CAPI_H_ diff --git a/include/capi/cef_stream_capi.h b/include/capi/cef_stream_capi.h index 8f474a3ba..f73fa39c3 100644 --- a/include/capi/cef_stream_capi.h +++ b/include/capi/cef_stream_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_STREAM_CAPI_H -#define _CEF_STREAM_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Structure the client can implement to provide a custom stream reader. The // functions of this structure may be called on any thread. /// -typedef struct _cef_read_handler_t -{ +typedef struct _cef_read_handler_t { /// // Base structure. /// @@ -63,21 +63,20 @@ typedef struct _cef_read_handler_t /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, - // SEEK_END or SEEK_SET. + // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, long offset, + int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, int64 offset, int whence); /// // Return the current offset position. /// - long (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self); + int64 (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self); /// // Return non-zero if at end of file. /// int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self); - } cef_read_handler_t; @@ -85,8 +84,7 @@ typedef struct _cef_read_handler_t // Structure used to read data from a stream. The functions of this structure // may be called on any thread. /// -typedef struct _cef_stream_reader_t -{ +typedef struct _cef_stream_reader_t { /// // Base structure. /// @@ -102,19 +100,18 @@ typedef struct _cef_stream_reader_t // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, long offset, + int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, int64 offset, int whence); /// // Return the current offset position. /// - long (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self); + int64 (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self); /// // Return non-zero if at end of file. /// int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self); - } cef_stream_reader_t; @@ -141,8 +138,7 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( // Structure the client can implement to provide a custom stream writer. The // functions of this structure may be called on any thread. /// -typedef struct _cef_write_handler_t -{ +typedef struct _cef_write_handler_t { /// // Base structure. /// @@ -156,21 +152,20 @@ typedef struct _cef_write_handler_t /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, - // SEEK_END or SEEK_SET. + // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, long offset, + int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, int64 offset, int whence); /// // Return the current offset position. /// - long (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self); + int64 (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self); /// // Flush the stream. /// int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self); - } cef_write_handler_t; @@ -178,8 +173,7 @@ typedef struct _cef_write_handler_t // Structure used to write data to a stream. The functions of this structure may // be called on any thread. /// -typedef struct _cef_stream_writer_t -{ +typedef struct _cef_stream_writer_t { /// // Base structure. /// @@ -193,21 +187,20 @@ typedef struct _cef_stream_writer_t /// // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, - // SEEK_END or SEEK_SET. + // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. /// - int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, long offset, + int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, int64 offset, int whence); /// // Return the current offset position. /// - long (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self); + int64 (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self); /// // Flush the stream. /// int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self); - } cef_stream_writer_t; @@ -228,4 +221,4 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( } #endif -#endif // _CEF_STREAM_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ diff --git a/include/capi/cef_task_capi.h b/include/capi/cef_task_capi.h index 299ab2758..cca4fbd9c 100644 --- a/include/capi/cef_task_capi.h +++ b/include/capi/cef_task_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_TASK_CAPI_H -#define _CEF_TASK_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -68,14 +69,13 @@ CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, // be called on any thread. /// CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, - struct _cef_task_t* task, long delay_ms); + struct _cef_task_t* task, int64 delay_ms); /// // Implement this structure for task execution. The functions of this structure // may be called on any thread. /// -typedef struct _cef_task_t -{ +typedef struct _cef_task_t { /// // Base structure. /// @@ -86,7 +86,6 @@ typedef struct _cef_task_t /// void (CEF_CALLBACK *execute)(struct _cef_task_t* self, cef_thread_id_t threadId); - } cef_task_t; @@ -94,4 +93,4 @@ typedef struct _cef_task_t } #endif -#endif // _CEF_TASK_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ diff --git a/include/capi/cef_url_capi.h b/include/capi/cef_url_capi.h index 47c928ab2..757875b39 100644 --- a/include/capi/cef_url_capi.h +++ b/include/capi/cef_url_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_URL_CAPI_H -#define _CEF_URL_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -63,4 +64,4 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, } #endif -#endif // _CEF_URL_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ diff --git a/include/capi/cef_v8_capi.h b/include/capi/cef_v8_capi.h index 840a7f5ba..f3783d5c6 100644 --- a/include/capi/cef_v8_capi.h +++ b/include/capi/cef_v8_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_V8_CAPI_H -#define _CEF_V8_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -106,8 +107,7 @@ CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, /// // Structure that encapsulates a V8 context handle. /// -typedef struct _cef_v8context_t -{ +typedef struct _cef_v8context_t { /// // Base structure. /// @@ -151,7 +151,6 @@ typedef struct _cef_v8context_t /// int (CEF_CALLBACK *is_same)(struct _cef_v8context_t* self, struct _cef_v8context_t* that); - } cef_v8context_t; @@ -175,8 +174,7 @@ CEF_EXPORT int cef_v8context_in_context(); // Structure that should be implemented to handle V8 function calls. The // functions of this structure will always be called on the UI thread. /// -typedef struct _cef_v8handler_t -{ +typedef struct _cef_v8handler_t { /// // Base structure. /// @@ -193,7 +191,6 @@ typedef struct _cef_v8handler_t const cef_string_t* name, struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, cef_string_t* exception); - } cef_v8handler_t; @@ -202,8 +199,7 @@ typedef struct _cef_v8handler_t // identifiers are registered by calling cef_v8value_t::set_value_byaccessor(). // The functions of this structure will always be called on the UI thread. /// -typedef struct _cef_v8accessor_t -{ +typedef struct _cef_v8accessor_t { /// // Base structure. /// @@ -230,15 +226,13 @@ typedef struct _cef_v8accessor_t int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self, const cef_string_t* name, struct _cef_v8value_t* object, struct _cef_v8value_t* value, cef_string_t* exception); - } cef_v8accessor_t; /// // Structure representing a V8 exception. /// -typedef struct _cef_v8exception_t -{ +typedef struct _cef_v8exception_t { /// // Base structure. /// @@ -295,7 +289,6 @@ typedef struct _cef_v8exception_t // occurred. /// int (CEF_CALLBACK *get_end_column)(struct _cef_v8exception_t* self); - } cef_v8exception_t; @@ -303,8 +296,7 @@ typedef struct _cef_v8exception_t // Structure representing a V8 value. The functions of this structure should // only be called on the UI thread. /// -typedef struct _cef_v8value_t -{ +typedef struct _cef_v8value_t { /// // Base structure. /// @@ -529,7 +521,6 @@ typedef struct _cef_v8value_t size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, struct _cef_v8exception_t** exception, int rethrow_exception); - } cef_v8value_t; @@ -600,4 +591,4 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, } #endif -#endif // _CEF_V8_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ diff --git a/include/capi/cef_v8context_handler_capi.h b/include/capi/cef_v8context_handler_capi.h index 43efc90fb..fa00e419b 100644 --- a/include/capi/cef_v8context_handler_capi.h +++ b/include/capi/cef_v8context_handler_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,22 +34,22 @@ // more information. // -#ifndef _CEF_V8CONTEXT_HANDLER_CAPI_H -#define _CEF_V8CONTEXT_HANDLER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_V8CONTEXT_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_V8CONTEXT_HANDLER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// // Implement this structure to handle V8 context events. The functions of this // structure will be called on the UI thread. /// -typedef struct _cef_v8context_handler_t -{ +typedef struct _cef_v8context_handler_t { /// // Base structure. /// @@ -71,7 +71,6 @@ typedef struct _cef_v8context_handler_t void (CEF_CALLBACK *on_context_released)( struct _cef_v8context_handler_t* self, struct _cef_browser_t* browser, struct _cef_frame_t* frame, struct _cef_v8context_t* context); - } cef_v8context_handler_t; @@ -79,4 +78,4 @@ typedef struct _cef_v8context_handler_t } #endif -#endif // _CEF_V8CONTEXT_HANDLER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_V8CONTEXT_HANDLER_CAPI_H_ diff --git a/include/capi/cef_web_urlrequest_capi.h b/include/capi/cef_web_urlrequest_capi.h index a8033388e..3e2cbb12d 100644 --- a/include/capi/cef_web_urlrequest_capi.h +++ b/include/capi/cef_web_urlrequest_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_WEB_URLREQUEST_CAPI_H -#define _CEF_WEB_URLREQUEST_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_WEB_URLREQUEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_WEB_URLREQUEST_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -49,8 +50,7 @@ extern "C" { // with a browser instance so no cef_client_t callbacks will be executed. The // functions of this structure may be called on any thread. /// -typedef struct _cef_web_urlrequest_t -{ +typedef struct _cef_web_urlrequest_t { /// // Base structure. /// @@ -66,7 +66,6 @@ typedef struct _cef_web_urlrequest_t /// enum cef_weburlrequest_state_t (CEF_CALLBACK *get_state)( struct _cef_web_urlrequest_t* self); - } cef_web_urlrequest_t; @@ -82,8 +81,7 @@ CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( // Structure that should be implemented by the cef_web_urlrequest_t client. The // functions of this structure will always be called on the UI thread. /// -typedef struct _cef_web_urlrequest_client_t -{ +typedef struct _cef_web_urlrequest_client_t { /// // Base structure. /// @@ -135,7 +133,6 @@ typedef struct _cef_web_urlrequest_client_t void (CEF_CALLBACK *on_error)(struct _cef_web_urlrequest_client_t* self, struct _cef_web_urlrequest_t* requester, enum cef_handler_errorcode_t errorCode); - } cef_web_urlrequest_client_t; @@ -143,4 +140,4 @@ typedef struct _cef_web_urlrequest_client_t } #endif -#endif // _CEF_WEB_URLREQUEST_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_WEB_URLREQUEST_CAPI_H_ diff --git a/include/capi/cef_xml_reader_capi.h b/include/capi/cef_xml_reader_capi.h index b5705fd03..c8585a53e 100644 --- a/include/capi/cef_xml_reader_capi.h +++ b/include/capi/cef_xml_reader_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_XML_READER_CAPI_H -#define _CEF_XML_READER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -49,8 +50,7 @@ extern "C" { // The functions of this structure should only be called on the thread that // creates the object. /// -typedef struct _cef_xml_reader_t -{ +typedef struct _cef_xml_reader_t { /// // Base structure. /// @@ -259,7 +259,6 @@ typedef struct _cef_xml_reader_t // cursor position was set successfully. /// int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self); - } cef_xml_reader_t; @@ -276,4 +275,4 @@ CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create( } #endif -#endif // _CEF_XML_READER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ diff --git a/include/capi/cef_zip_reader_capi.h b/include/capi/cef_zip_reader_capi.h index be95c7991..d7988afcb 100644 --- a/include/capi/cef_zip_reader_capi.h +++ b/include/capi/cef_zip_reader_capi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -34,14 +34,15 @@ // more information. // -#ifndef _CEF_ZIP_READER_CAPI_H -#define _CEF_ZIP_READER_CAPI_H +#ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ +#pragma once #ifdef __cplusplus extern "C" { #endif -#include "cef_base_capi.h" +#include "include/capi/cef_base_capi.h" /// @@ -49,8 +50,7 @@ extern "C" { // The functions of this structure should only be called on the thread that // creates the object. /// -typedef struct _cef_zip_reader_t -{ +typedef struct _cef_zip_reader_t { /// // Base structure. /// @@ -95,7 +95,7 @@ typedef struct _cef_zip_reader_t /// // Returns the uncompressed size of the file. /// - long (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self); + int64 (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self); /// // Returns the last modified timestamp for the file. @@ -124,13 +124,12 @@ typedef struct _cef_zip_reader_t /// // Returns the current offset in the uncompressed file contents. /// - long (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self); + int64 (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self); /// // Returns true (1) if at end of the file contents. /// int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self); - } cef_zip_reader_t; @@ -146,4 +145,4 @@ CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( } #endif -#endif // _CEF_ZIP_READER_CAPI_H +#endif // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ diff --git a/include/cef_app.h b/include/cef_app.h index 7db5d9fe1..84b1e2989 100644 --- a/include/cef_app.h +++ b/include/cef_app.h @@ -35,11 +35,12 @@ // -#ifndef _CEF_APP_H -#define _CEF_APP_H +#ifndef CEF_INCLUDE_CEF_APP_H_ +#define CEF_INCLUDE_CEF_APP_H_ +#pragma once -#include "cef_base.h" -#include "cef_proxy_handler.h" +#include "include/cef_base.h" +#include "include/cef_proxy_handler.h" class CefApp; @@ -94,9 +95,8 @@ void CefQuitMessageLoop(); // Implement this interface to provide handler implementations. /// /*--cef(source=client,no_debugct_check)--*/ -class CefApp : public virtual CefBase -{ -public: +class CefApp : public virtual CefBase { + public: /// // Return the handler for proxy events. If not handler is returned the default // system handler will be used. @@ -105,4 +105,4 @@ public: virtual CefRefPtr GetProxyHandler() { return NULL; } }; -#endif // _CEF_APP_H +#endif // CEF_INCLUDE_CEF_APP_H_ diff --git a/include/cef_application_mac.h b/include/cef_application_mac.h index 47944f463..33042478c 100644 --- a/include/cef_application_mac.h +++ b/include/cef_application_mac.h @@ -27,11 +27,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef _CEF_APPLICATION_MAC_H -#define _CEF_APPLICATION_MAC_H +#ifndef CEF_INCLUDE_CEF_APPLICATION_MAC_H_ +#define CEF_INCLUDE_CEF_APPLICATION_MAC_H_ #pragma once -#include "cef_base.h" +#include "include/cef_base.h" #if defined(OS_MACOSX) && defined(__OBJC__) @@ -43,7 +43,7 @@ // Use the existing empty protocol definitions. #import "base/mac/cocoa_protocols.h" -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #import #import @@ -88,7 +88,7 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate) #endif -#endif // BUILDING_CEF_SHARED +#endif // BUILDING_CEF_SHARED // All CEF client applications must subclass NSApplication and implement this // protocol. @@ -99,7 +99,7 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate) // Controls the state of |isHandlingSendEvent| in the event loop so that it is // reset properly. class CefScopedSendingEvent { -public: + public: CefScopedSendingEvent() : app_(static_cast*>( [NSApplication sharedApplication])), @@ -109,12 +109,12 @@ public: ~CefScopedSendingEvent() { [app_ setHandlingSendEvent:handling_]; } - -private: + + private: NSApplication* app_; BOOL handling_; }; #endif // defined(OS_MACOSX) && defined(__OBJC__) -#endif // _CEF_APPLICATION_MAC_H +#endif // CEF_INCLUDE_CEF_APPLICATION_MAC_H_ diff --git a/include/cef_base.h b/include/cef_base.h index 3ca429be2..5fc964fa3 100644 --- a/include/cef_base.h +++ b/include/cef_base.h @@ -35,29 +35,29 @@ // -#ifndef _CEF_BASE_H -#define _CEF_BASE_H +#ifndef CEF_INCLUDE_CEF_BASE_H_ +#define CEF_INCLUDE_CEF_BASE_H_ +#pragma once -#include "internal/cef_build.h" -#include "internal/cef_ptr.h" -#include "internal/cef_types_wrappers.h" +#include "include/internal/cef_build.h" +#include "include/internal/cef_ptr.h" +#include "include/internal/cef_types_wrappers.h" // Bring in platform-specific definitions. #if defined(OS_WIN) -#include "internal/cef_win.h" +#include "include/internal/cef_win.h" #elif defined(OS_MACOSX) -#include "internal/cef_mac.h" +#include "include/internal/cef_mac.h" #elif defined(OS_LINUX) -#include "internal/cef_linux.h" +#include "include/internal/cef_linux.h" #endif /// // Interface defining the reference count implementation methods. All framework // classes must extend the CefBase class. /// -class CefBase -{ -public: +class CefBase { + public: /// // The AddRef method increments the reference count for the object. It should // be called for every new copy of a pointer to a given object. The resulting @@ -79,7 +79,7 @@ public: /// virtual int GetRefCt() =0; -protected: + protected: virtual ~CefBase() {} }; @@ -87,11 +87,10 @@ protected: /// // Class that implements atomic reference counting. /// -class CefRefCount -{ -public: +class CefRefCount { + public: CefRefCount() : refct_(0) {} - + /// // Atomic reference increment. /// @@ -111,8 +110,8 @@ public: /// int GetRefCt() { return refct_; } -private: - long refct_; + private: + long refct_; // NOLINT(runtime/int) }; /// @@ -124,7 +123,7 @@ private: int AddRef() { return refct_.AddRef(); } \ int Release() { \ int retval = refct_.Release(); \ - if(retval == 0) \ + if (retval == 0) \ delete this; \ return retval; \ } \ @@ -138,18 +137,18 @@ private: // threads. The AutoLock class is a helper that will hold the lock while in // scope. /// -#define IMPLEMENT_LOCKING(ClassName) \ - public: \ - class AutoLock { \ - public: \ - AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ - ~AutoLock() { base_->Unlock(); } \ - private: \ - ClassName* base_; \ - }; \ - void Lock() { critsec_.Lock(); } \ - void Unlock() { critsec_.Unlock(); } \ - private: \ +#define IMPLEMENT_LOCKING(ClassName) \ + public: \ + class AutoLock { \ + public: \ + explicit AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ + ~AutoLock() { base_->Unlock(); } \ + private: \ + ClassName* base_; \ + }; \ + void Lock() { critsec_.Lock(); } \ + void Unlock() { critsec_.Unlock(); } \ + private: \ CefCriticalSection critsec_; -#endif // _CEF_BASE_H +#endif // CEF_INCLUDE_CEF_BASE_H_ diff --git a/include/cef_browser.h b/include/cef_browser.h index 7ce0a2413..03e553be4 100644 --- a/include/cef_browser.h +++ b/include/cef_browser.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_BROWSER_H -#define _CEF_BROWSER_H +#ifndef CEF_INCLUDE_CEF_BROWSER_H_ +#define CEF_INCLUDE_CEF_BROWSER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include class CefClient; @@ -48,9 +49,8 @@ class CefFrame; // called on any thread unless otherwise indicated in the comments. /// /*--cef(source=library)--*/ -class CefBrowser : public virtual CefBase -{ -public: +class CefBrowser : public virtual CefBase { + public: typedef cef_key_type_t KeyType; typedef cef_mouse_button_type_t MouseButtonType; typedef cef_paint_element_type_t PaintElementType; @@ -146,7 +146,7 @@ public: /// /*--cef()--*/ virtual CefWindowHandle GetOpenerWindowHandle() =0; - + /// // Returns true if the window is a popup window. /// @@ -274,7 +274,7 @@ public: /// // Invalidate the |dirtyRect| region of the view. This method is only used // when window rendering is disabled and will result in a call to - // HandlePaint(). + // HandlePaint(). /// /*--cef()--*/ virtual void Invalidate(const CefRect& dirtyRect) =0; @@ -295,7 +295,7 @@ public: /// /*--cef()--*/ virtual void SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar, - bool imeChar) =0; + bool imeChar) =0; /// // Send a mouse click event to the browser. The |x| and |y| coordinates are @@ -332,4 +332,4 @@ public: virtual void SendCaptureLostEvent() =0; }; -#endif // _CEF_BROWSER_H +#endif // CEF_INCLUDE_CEF_BROWSER_H_ diff --git a/include/cef_client.h b/include/cef_client.h index 8ec3ccc8c..5e10971b8 100644 --- a/include/cef_client.h +++ b/include/cef_client.h @@ -34,38 +34,37 @@ // tools directory for more information. // -#ifndef _CEF_CLIENT_H -#define _CEF_CLIENT_H +#ifndef CEF_INCLUDE_CEF_CLIENT_H_ +#define CEF_INCLUDE_CEF_CLIENT_H_ +#pragma once -#include "cef_base.h" -#include "cef_display_handler.h" -#include "cef_drag_handler.h" -#include "cef_find_handler.h" -#include "cef_focus_handler.h" -#include "cef_jsdialog_handler.h" -#include "cef_keyboard_handler.h" -#include "cef_life_span_handler.h" -#include "cef_load_handler.h" -#include "cef_menu_handler.h" -#include "cef_permission_handler.h" -#include "cef_print_handler.h" -#include "cef_render_handler.h" -#include "cef_request_handler.h" -#include "cef_v8context_handler.h" +#include "include/cef_base.h" +#include "include/cef_display_handler.h" +#include "include/cef_drag_handler.h" +#include "include/cef_find_handler.h" +#include "include/cef_focus_handler.h" +#include "include/cef_jsdialog_handler.h" +#include "include/cef_keyboard_handler.h" +#include "include/cef_life_span_handler.h" +#include "include/cef_load_handler.h" +#include "include/cef_menu_handler.h" +#include "include/cef_permission_handler.h" +#include "include/cef_print_handler.h" +#include "include/cef_render_handler.h" +#include "include/cef_request_handler.h" +#include "include/cef_v8context_handler.h" /// // Implement this interface to provide handler implementations. /// /*--cef(source=client,no_debugct_check)--*/ -class CefClient : public virtual CefBase -{ -public: +class CefClient : public virtual CefBase { + public: /// // Return the handler for browser life span events. /// /*--cef()--*/ - virtual CefRefPtr GetLifeSpanHandler() - { + virtual CefRefPtr GetLifeSpanHandler() { return NULL; } @@ -73,8 +72,7 @@ public: // Return the handler for browser load status events. /// /*--cef()--*/ - virtual CefRefPtr GetLoadHandler() - { + virtual CefRefPtr GetLoadHandler() { return NULL; } @@ -82,8 +80,7 @@ public: // Return the handler for browser request events. /// /*--cef()--*/ - virtual CefRefPtr GetRequestHandler() - { + virtual CefRefPtr GetRequestHandler() { return NULL; } @@ -91,8 +88,7 @@ public: // Return the handler for browser display state events. /// /*--cef()--*/ - virtual CefRefPtr GetDisplayHandler() - { + virtual CefRefPtr GetDisplayHandler() { return NULL; } @@ -100,8 +96,7 @@ public: // Return the handler for focus events. /// /*--cef()--*/ - virtual CefRefPtr GetFocusHandler() - { + virtual CefRefPtr GetFocusHandler() { return NULL; } @@ -109,8 +104,7 @@ public: // Return the handler for keyboard events. /// /*--cef()--*/ - virtual CefRefPtr GetKeyboardHandler() - { + virtual CefRefPtr GetKeyboardHandler() { return NULL; } @@ -118,8 +112,7 @@ public: // Return the handler for context menu events. /// /*--cef()--*/ - virtual CefRefPtr GetMenuHandler() - { + virtual CefRefPtr GetMenuHandler() { return NULL; } @@ -127,8 +120,7 @@ public: // Return the handler for browser permission events. /// /*--cef()--*/ - virtual CefRefPtr GetPermissionHandler() - { + virtual CefRefPtr GetPermissionHandler() { return NULL; } @@ -136,8 +128,7 @@ public: // Return the handler for printing events. /// /*--cef()--*/ - virtual CefRefPtr GetPrintHandler() - { + virtual CefRefPtr GetPrintHandler() { return NULL; } @@ -145,8 +136,7 @@ public: // Return the handler for find result events. /// /*--cef()--*/ - virtual CefRefPtr GetFindHandler() - { + virtual CefRefPtr GetFindHandler() { return NULL; } @@ -154,8 +144,7 @@ public: // Return the handler for JavaScript dialog events. /// /*--cef()--*/ - virtual CefRefPtr GetJSDialogHandler() - { + virtual CefRefPtr GetJSDialogHandler() { return NULL; } @@ -163,8 +152,7 @@ public: // Return the handler for V8 context events. /// /*--cef()--*/ - virtual CefRefPtr GetV8ContextHandler() - { + virtual CefRefPtr GetV8ContextHandler() { return NULL; } @@ -172,8 +160,7 @@ public: // Return the handler for off-screen rendering events. /// /*--cef()--*/ - virtual CefRefPtr GetRenderHandler() - { + virtual CefRefPtr GetRenderHandler() { return NULL; } @@ -181,10 +168,9 @@ public: // Return the handler for drag events. /// /*--cef()--*/ - virtual CefRefPtr GetDragHandler() - { + virtual CefRefPtr GetDragHandler() { return NULL; } }; -#endif // _CEF_CLIENT_H +#endif // CEF_INCLUDE_CEF_CLIENT_H_ diff --git a/include/cef_command_line.h b/include/cef_command_line.h index 4d8335a57..a698187ee 100644 --- a/include/cef_command_line.h +++ b/include/cef_command_line.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_COMMAND_LINE_H -#define _CEF_COMMAND_LINE_H +#ifndef CEF_INCLUDE_CEF_COMMAND_LINE_H_ +#define CEF_INCLUDE_CEF_COMMAND_LINE_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include #include @@ -45,18 +46,17 @@ // Class used to create and/or parse command line arguments. Arguments with // '--', '-' and, on Windows, '/' prefixes are considered switches. Switches // will always precede any arguments without switch prefixes. Switches can -// optionally have a value specified using the '=' delimiter (e.g. +// optionally have a value specified using the '=' delimiter (e.g. // "-switch=value"). An argument of "--" will terminate switch parsing with all // subsequent tokens, regardless of prefix, being interpreted as non-switch // arguments. Switch names are considered case-insensitive. This class can be // used before CefInitialize() is called. /// /*--cef(source=library,no_debugct_check)--*/ -class CefCommandLine : public virtual CefBase -{ -public: +class CefCommandLine : public virtual CefBase { + public: typedef std::vector ArgumentList; - typedef std::map SwitchMap; + typedef std::map SwitchMap; /// // Create a new CefCommandLine instance. @@ -118,7 +118,7 @@ public: virtual CefString GetSwitchValue(const CefString& name) =0; /// - // Returns the map of switch names and values. If a switch has no value an + // Returns the map of switch names and values. If a switch has no value an // empty string is returned. /// /*--cef()--*/ @@ -157,4 +157,4 @@ public: virtual void AppendArgument(const CefString& argument) =0; }; -#endif // _CEF_COMMAND_LINE_H +#endif // CEF_INCLUDE_CEF_COMMAND_LINE_H_ diff --git a/include/cef_content_filter.h b/include/cef_content_filter.h index fd3619879..223ab4264 100644 --- a/include/cef_content_filter.h +++ b/include/cef_content_filter.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_CONTENT_FILTER_H -#define _CEF_CONTENT_FILTER_H +#ifndef CEF_INCLUDE_CEF_CONTENT_FILTER_H_ +#define CEF_INCLUDE_CEF_CONTENT_FILTER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefStreamReader; @@ -46,9 +47,8 @@ class CefStreamReader; // class will always be called on the UI thread. /// /*--cef(source=client)--*/ -class CefContentFilter : public virtual CefBase -{ -public: +class CefContentFilter : public virtual CefBase { + public: /// // Set |substitute_data| to the replacement for the data in |data| if data // should be modified. @@ -66,4 +66,4 @@ public: virtual void Drain(CefRefPtr& remainder) {} }; -#endif // _CEF_CONTENT_FILTER_H +#endif // CEF_INCLUDE_CEF_CONTENT_FILTER_H_ diff --git a/include/cef_cookie.h b/include/cef_cookie.h index 4a344e58d..932bab20f 100644 --- a/include/cef_cookie.h +++ b/include/cef_cookie.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_COOKIE_H -#define _CEF_COOKIE_H +#ifndef CEF_INCLUDE_CEF_COOKIE_H_ +#define CEF_INCLUDE_CEF_COOKIE_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefCookieVisitor; @@ -95,9 +96,8 @@ bool CefSetCookiePath(const CefString& path); // will always be called on the IO thread. /// /*--cef(source=client)--*/ -class CefCookieVisitor : public virtual CefBase -{ -public: +class CefCookieVisitor : public virtual CefBase { + public: /// // Method that will be called once for each cookie. |count| is the 0-based // index for the current cookie. |total| is the total number of cookies. @@ -110,4 +110,4 @@ public: bool& deleteCookie) =0; }; -#endif // _CEF_COOKIE_H +#endif // CEF_INCLUDE_CEF_COOKIE_H_ diff --git a/include/cef_display_handler.h b/include/cef_display_handler.h index c68694bd9..f2d055b9e 100644 --- a/include/cef_display_handler.h +++ b/include/cef_display_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_DISPLAY_HANDLER_H -#define _CEF_DISPLAY_HANDLER_H +#ifndef CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ +#define CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefFrame; @@ -47,9 +48,8 @@ class CefFrame; // The methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefDisplayHandler : public virtual CefBase -{ -public: +class CefDisplayHandler : public virtual CefBase { + public: typedef cef_handler_statustype_t StatusType; /// @@ -115,4 +115,4 @@ public: int line) { return false; } }; -#endif // _CEF_DISPLAY_HANDLER_H +#endif // CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ diff --git a/include/cef_dom.h b/include/cef_dom.h index d40f41675..b56050d87 100644 --- a/include/cef_dom.h +++ b/include/cef_dom.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_DOM_H -#define _CEF_DOM_H +#ifndef CEF_INCLUDE_CEF_DOM_H_ +#define CEF_INCLUDE_CEF_DOM_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include class CefDOMDocument; @@ -49,9 +50,8 @@ class CefDOMNode; // be called on the UI thread. /// /*--cef(source=client)--*/ -class CefDOMVisitor : public virtual CefBase -{ -public: +class CefDOMVisitor : public virtual CefBase { + public: /// // Method executed for visiting the DOM. The document object passed to this // method represents a snapshot of the DOM at the time this method is @@ -69,9 +69,8 @@ public: // be called on the UI thread. /// /*--cef(source=library)--*/ -class CefDOMDocument : public virtual CefBase -{ -public: +class CefDOMDocument : public virtual CefBase { + public: typedef cef_dom_document_type_t Type; /// @@ -178,10 +177,9 @@ public: // called on the UI thread. /// /*--cef(source=library)--*/ -class CefDOMNode : public virtual CefBase -{ -public: - typedef std::map AttributeMap; +class CefDOMNode : public virtual CefBase { + public: + typedef std::map AttributeMap; typedef cef_dom_node_type_t Type; /// @@ -356,9 +354,8 @@ public: // be called on the UI thread. /// /*--cef(source=library)--*/ -class CefDOMEvent : public virtual CefBase -{ -public: +class CefDOMEvent : public virtual CefBase { + public: typedef cef_dom_event_category_t Category; typedef cef_dom_event_phase_t Phase; @@ -417,9 +414,8 @@ public: // will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefDOMEventListener : public virtual CefBase -{ -public: +class CefDOMEventListener : public virtual CefBase { + public: /// // Called when an event is received. The event object passed to this method // contains a snapshot of the DOM at the time this method is executed. DOM @@ -430,4 +426,4 @@ public: virtual void HandleEvent(CefRefPtr event) =0; }; -#endif // _CEF_DOM_H +#endif // CEF_INCLUDE_CEF_DOM_H_ diff --git a/include/cef_download_handler.h b/include/cef_download_handler.h index 3fb704052..8fd209447 100644 --- a/include/cef_download_handler.h +++ b/include/cef_download_handler.h @@ -34,19 +34,19 @@ // tools directory for more information. // -#ifndef _CEF_DOWNLOAD_HANDLER_H -#define _CEF_DOWNLOAD_HANDLER_H +#ifndef CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ +#define CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" /// // Class used to handle file downloads. The methods of this class will always be // called on the UI thread. /// /*--cef(source=client)--*/ -class CefDownloadHandler : public virtual CefBase -{ -public: +class CefDownloadHandler : public virtual CefBase { + public: /// // A portion of the file contents have been received. This method will be // called multiple times until the download is complete. Return |true| to @@ -62,4 +62,4 @@ public: virtual void Complete() =0; }; -#endif // _CEF_DOWNLOAD_HANDLER_H +#endif // CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ diff --git a/include/cef_drag_data.h b/include/cef_drag_data.h index 8e63bc1f6..99487b3ae 100644 --- a/include/cef_drag_data.h +++ b/include/cef_drag_data.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_DRAG_DATA_H -#define _CEF_DRAG_DATA_H +#ifndef CEF_INCLUDE_CEF_DRAG_DATA_H_ +#define CEF_INCLUDE_CEF_DRAG_DATA_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include /// @@ -45,9 +46,8 @@ // on any thread. /// /*--cef(source=library)--*/ -class CefDragData : public virtual CefBase -{ -public: +class CefDragData : public virtual CefBase { + public: /// // Returns true if the drag data is a link. /// @@ -123,4 +123,4 @@ public: virtual bool GetFileNames(std::vector& names) =0; }; -#endif // _CEF_DRAG_DATA_H +#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_ diff --git a/include/cef_drag_handler.h b/include/cef_drag_handler.h index 0e0f5a88a..078b9630c 100644 --- a/include/cef_drag_handler.h +++ b/include/cef_drag_handler.h @@ -34,11 +34,12 @@ // tools directory for more information. // -#ifndef _CEF_DRAG_HANDLER_H -#define _CEF_DRAG_HANDLER_H +#ifndef CEF_INCLUDE_CEF_DRAG_HANDLER_H_ +#define CEF_INCLUDE_CEF_DRAG_HANDLER_H_ +#pragma once -#include "cef_base.h" -#include "cef_drag_data.h" +#include "include/cef_base.h" +#include "include/cef_drag_data.h" class CefBrowser; @@ -47,9 +48,8 @@ class CefBrowser; // this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefDragHandler : public virtual CefBase -{ -public: +class CefDragHandler : public virtual CefBase { + public: typedef cef_drag_operations_mask_t DragOperationsMask; /// @@ -75,4 +75,4 @@ public: DragOperationsMask mask) { return false; } }; -#endif // _CEF_DRAG_HANDLER_H +#endif // CEF_INCLUDE_CEF_DRAG_HANDLER_H_ diff --git a/include/cef_find_handler.h b/include/cef_find_handler.h index 1310e55bd..a5d22e444 100644 --- a/include/cef_find_handler.h +++ b/include/cef_find_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_FIND_HANDLER_H -#define _CEF_FIND_HANDLER_H +#ifndef CEF_INCLUDE_CEF_FIND_HANDLER_H_ +#define CEF_INCLUDE_CEF_FIND_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; @@ -46,9 +47,8 @@ class CefBrowser; // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefFindHandler : public virtual CefBase -{ -public: +class CefFindHandler : public virtual CefBase { + public: /// // Called to report find results returned by CefBrowser::Find(). |identifer| // is the identifier passed to CefBrowser::Find(), |count| is the number of @@ -66,4 +66,4 @@ public: bool finalUpdate) {} }; -#endif // _CEF_FIND_HANDLER_H +#endif // CEF_INCLUDE_CEF_FIND_HANDLER_H_ diff --git a/include/cef_focus_handler.h b/include/cef_focus_handler.h index 4a882e7b2..0b4df8cfd 100644 --- a/include/cef_focus_handler.h +++ b/include/cef_focus_handler.h @@ -34,11 +34,12 @@ // tools directory for more information. // -#ifndef _CEF_FOCUS_HANDLER_H -#define _CEF_FOCUS_HANDLER_H +#ifndef CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ +#define CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ +#pragma once -#include "cef_base.h" -#include "cef_dom.h" +#include "include/cef_base.h" +#include "include/cef_dom.h" class CefBrowser; class CefFrame; @@ -48,9 +49,8 @@ class CefFrame; // this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefFocusHandler : public virtual CefBase -{ -public: +class CefFocusHandler : public virtual CefBase { + public: typedef cef_handler_focus_source_t FocusSource; /// @@ -86,4 +86,4 @@ public: CefRefPtr node) {} }; -#endif // _CEF_FOCUS_HANDLER_H +#endif // CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ diff --git a/include/cef_frame.h b/include/cef_frame.h index ce29cc071..4b3a7911f 100644 --- a/include/cef_frame.h +++ b/include/cef_frame.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_FRAME_H -#define _CEF_FRAME_H +#ifndef CEF_INCLUDE_CEF_FRAME_H_ +#define CEF_INCLUDE_CEF_FRAME_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefDOMVisitor; @@ -50,9 +51,8 @@ class CefV8Context; // class may be called on any thread unless otherwise indicated in the comments. /// /*--cef(source=library)--*/ -class CefFrame : public virtual CefBase -{ -public: +class CefFrame : public virtual CefBase { + public: /// // Execute undo in this frame. /// @@ -130,10 +130,10 @@ public: virtual void LoadURL(const CefString& url) =0; /// - // Load the contents of |string| with the optional dummy target |url|. + // Load the contents of |string_val| with the optional dummy target |url|. /// /*--cef()--*/ - virtual void LoadString(const CefString& string, + virtual void LoadString(const CefString& string_val, const CefString& url) =0; /// @@ -151,7 +151,7 @@ public: // reporting. /// /*--cef(optional_param=scriptUrl)--*/ - virtual void ExecuteJavaScript(const CefString& jsCode, + virtual void ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, int startLine) =0; @@ -183,7 +183,7 @@ public: // only be called on the UI thread. /// /*--cef()--*/ - virtual long long GetIdentifier() =0; + virtual int64 GetIdentifier() =0; /// // Returns the parent of this frame or NULL if this is the main (top-level) @@ -219,4 +219,4 @@ public: virtual CefRefPtr GetV8Context() =0; }; -#endif // _CEF_FRAME_H +#endif // CEF_INCLUDE_CEF_FRAME_H_ diff --git a/include/cef_jsdialog_handler.h b/include/cef_jsdialog_handler.h index f252538c1..f0db01ee2 100644 --- a/include/cef_jsdialog_handler.h +++ b/include/cef_jsdialog_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_JSDIALOG_HANDLER_H -#define _CEF_JSDIALOG_HANDLER_H +#ifndef CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ +#define CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefFrame; @@ -47,9 +48,8 @@ class CefFrame; // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefJSDialogHandler : public virtual CefBase -{ -public: +class CefJSDialogHandler : public virtual CefBase { + public: /// // Called to run a JavaScript alert message. Return false to display the // default alert or true if you displayed a custom alert. @@ -85,4 +85,4 @@ public: CefString& result) { return false; } }; -#endif // _CEF_JSDIALOG_HANDLER_H +#endif // CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ diff --git a/include/cef_keyboard_handler.h b/include/cef_keyboard_handler.h index 6daca769d..e61b383c4 100644 --- a/include/cef_keyboard_handler.h +++ b/include/cef_keyboard_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_KEYBOARD_HANDLER_H -#define _CEF_KEYBOARD_HANDLER_H +#ifndef CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ +#define CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; @@ -46,9 +47,8 @@ class CefBrowser; // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefKeyboardHandler : public virtual CefBase -{ -public: +class CefKeyboardHandler : public virtual CefBase { + public: typedef cef_handler_keyevent_type_t KeyEventType; /// @@ -74,4 +74,4 @@ public: bool isAfterJavaScript) { return false; } }; -#endif // _CEF_KEYBOARD_HANDLER_H +#endif // CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ diff --git a/include/cef_life_span_handler.h b/include/cef_life_span_handler.h index a4222a8b9..62753d52d 100644 --- a/include/cef_life_span_handler.h +++ b/include/cef_life_span_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_LIFE_SPAN_HANDLER_H -#define _CEF_LIFE_SPAN_HANDLER_H +#ifndef CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ +#define CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefClient; @@ -47,9 +48,8 @@ class CefClient; // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefLifeSpanHandler : public virtual CefBase -{ -public: +class CefLifeSpanHandler : public virtual CefBase { + public: /// // Called before a new popup window is created. The |parentBrowser| parameter // will point to the parent browser window. The |popupFeatures| parameter will @@ -102,4 +102,4 @@ public: virtual void OnBeforeClose(CefRefPtr browser) {} }; -#endif // _CEF_LIFE_SPAN_HANDLER_H +#endif // CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ diff --git a/include/cef_load_handler.h b/include/cef_load_handler.h index 73b8e9e29..3e1184b1d 100644 --- a/include/cef_load_handler.h +++ b/include/cef_load_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_LOAD_HANDLER_H -#define _CEF_LOAD_HANDLER_H +#ifndef CEF_INCLUDE_CEF_LOAD_HANDLER_H_ +#define CEF_INCLUDE_CEF_LOAD_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefFrame; @@ -47,9 +48,8 @@ class CefFrame; // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefLoadHandler : public virtual CefBase -{ -public: +class CefLoadHandler : public virtual CefBase { + public: typedef cef_handler_errorcode_t ErrorCode; /// @@ -92,4 +92,4 @@ public: CefString& errorText) { return false; } }; -#endif // _CEF_LOAD_HANDLER_H +#endif // CEF_INCLUDE_CEF_LOAD_HANDLER_H_ diff --git a/include/cef_menu_handler.h b/include/cef_menu_handler.h index 509cfad28..40509cc02 100644 --- a/include/cef_menu_handler.h +++ b/include/cef_menu_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_MENU_HANDLER_H -#define _CEF_MENU_HANDLER_H +#ifndef CEF_INCLUDE_CEF_MENU_HANDLER_H_ +#define CEF_INCLUDE_CEF_MENU_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; @@ -46,9 +47,8 @@ class CefBrowser; // The methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefMenuHandler : public virtual CefBase -{ -public: +class CefMenuHandler : public virtual CefBase { + public: typedef cef_menu_id_t MenuId; /// @@ -78,4 +78,4 @@ public: MenuId menuId) { return false; } }; -#endif // _CEF_MENU_HANDLER_H +#endif // CEF_INCLUDE_CEF_MENU_HANDLER_H_ diff --git a/include/cef_nplugin.h b/include/cef_nplugin.h index 59f314455..4b16fe91f 100644 --- a/include/cef_nplugin.h +++ b/include/cef_nplugin.h @@ -28,8 +28,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef _CEF_NPLUGIN_H -#define _CEF_NPLUGIN_H +#ifndef CEF_INCLUDE_CEF_NPLUGIN_H_ +#define CEF_INCLUDE_CEF_NPLUGIN_H_ +#pragma once #include "internal/cef_nplugin_types.h" @@ -44,31 +45,25 @@ // This class provides attribute information and entry point functions for a // plugin. /// -class CefPluginInfo : public cef_plugin_info_t -{ -public: - CefPluginInfo() - { +class CefPluginInfo : public cef_plugin_info_t { + public: + CefPluginInfo() { Init(); } - virtual ~CefPluginInfo() - { + virtual ~CefPluginInfo() { Reset(); } - CefPluginInfo(const CefPluginInfo& r) - { + CefPluginInfo(const CefPluginInfo& r) { // NOLINT(runtime/explicit) Init(); *this = r; } - CefPluginInfo(const cef_plugin_info_t& r) - { + CefPluginInfo(const cef_plugin_info_t& r) { // NOLINT(runtime/explicit) Init(); *this = r; } - void Reset() - { + void Reset() { cef_string_clear(&unique_name); cef_string_clear(&display_name); cef_string_clear(&version); @@ -79,24 +74,20 @@ public: Init(); } - void Attach(const cef_plugin_info_t& r) - { + void Attach(const cef_plugin_info_t& r) { Reset(); *static_cast(this) = r; } - void Detach() - { + void Detach() { Init(); } - CefPluginInfo& operator=(const CefPluginInfo& r) - { + CefPluginInfo& operator=(const CefPluginInfo& r) { return operator=(static_cast(r)); } - CefPluginInfo& operator=(const cef_plugin_info_t& r) - { + CefPluginInfo& operator=(const cef_plugin_info_t& r) { cef_string_copy(r.unique_name.str, r.unique_name.length, &unique_name); cef_string_copy(r.display_name.str, r.display_name.length, &display_name); cef_string_copy(r.version.str, r.version.length, &version); @@ -114,9 +105,8 @@ public: return *this; } -protected: - void Init() - { + protected: + void Init() { memset(static_cast(this), 0, sizeof(cef_plugin_info_t)); } }; @@ -126,4 +116,4 @@ protected: /// bool CefRegisterPlugin(const CefPluginInfo& plugin_info); -#endif // _CEF_NPLUGIN_H +#endif // CEF_INCLUDE_CEF_NPLUGIN_H_ diff --git a/include/cef_origin_whitelist.h b/include/cef_origin_whitelist.h index e71550182..fce2e805e 100644 --- a/include/cef_origin_whitelist.h +++ b/include/cef_origin_whitelist.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_ORIGIN_WHITELIST_H -#define _CEF_ORIGIN_WHITELIST_H +#ifndef CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ +#define CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" /// @@ -51,13 +52,13 @@ // XMLHttpRequest requests on http://target.example.com if the // http://target.example.com request returns an "Access-Control-Allow-Origin: // https://source.example.com" response header. -// +// // Scripts in separate frames or iframes and hosted from the same protocol and // domain suffix can execute cross-origin JavaScript if both pages set the // document.domain value to the same domain suffix. For example, // scheme://foo.example.com and scheme://bar.example.com can communicate using // JavaScript if both domains set document.domain="example.com". -// +// // This method is used to allow access to origins that would otherwise violate // the same-origin policy. Scripts hosted underneath the fully qualified // |source_origin| URL (like http://www.example.com) will be allowed access to @@ -95,4 +96,4 @@ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, /*--cef()--*/ bool CefClearCrossOriginWhitelist(); -#endif // _CEF_ORIGIN_WHITELIST_H +#endif // CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ diff --git a/include/cef_permission_handler.h b/include/cef_permission_handler.h index 060315bbc..40cafcda7 100644 --- a/include/cef_permission_handler.h +++ b/include/cef_permission_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_PERMISSION_HANDLER_H -#define _CEF_PERMISSION_HANDLER_H +#ifndef CEF_INCLUDE_CEF_PERMISSION_HANDLER_H_ +#define CEF_INCLUDE_CEF_PERMISSION_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefFrame; @@ -47,9 +48,8 @@ class CefFrame; // The methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefPermissionHandler : public virtual CefBase -{ -public: +class CefPermissionHandler : public virtual CefBase { + public: /// // Called on the UI thread before a script extension is loaded. // Return false to let the extension load normally. @@ -57,10 +57,9 @@ public: /*--cef()--*/ virtual bool OnBeforeScriptExtensionLoad(CefRefPtr browser, CefRefPtr frame, - const CefString& extensionName) - { + const CefString& extensionName) { return false; } }; -#endif // _CEF_PERMISSION_HANDLER_H +#endif // CEF_INCLUDE_CEF_PERMISSION_HANDLER_H_ diff --git a/include/cef_print_handler.h b/include/cef_print_handler.h index a4e91fb60..9c2935af9 100644 --- a/include/cef_print_handler.h +++ b/include/cef_print_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_PRINT_HANDLER_H -#define _CEF_PRINT_HANDLER_H +#ifndef CEF_INCLUDE_CEF_PRINT_HANDLER_H_ +#define CEF_INCLUDE_CEF_PRINT_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefFrame; @@ -47,9 +48,8 @@ class CefFrame; // this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefPrintHandler : public virtual CefBase -{ -public: +class CefPrintHandler : public virtual CefBase { + public: /// // Called to allow customization of standard print options before the print // dialog is displayed. |printOptions| allows specification of paper size, @@ -89,4 +89,4 @@ public: CefString& bottomRight) { return false; } }; -#endif // _CEF_PRINT_HANDLER_H +#endif // CEF_INCLUDE_CEF_PRINT_HANDLER_H_ diff --git a/include/cef_proxy_handler.h b/include/cef_proxy_handler.h index 024ebd553..d40c67d7c 100644 --- a/include/cef_proxy_handler.h +++ b/include/cef_proxy_handler.h @@ -34,18 +34,18 @@ // tools directory for more information. // -#ifndef _CEF_PROXY_HANDLER_H -#define _CEF_PROXY_HANDLER_H +#ifndef CEF_INCLUDE_CEF_PROXY_HANDLER_H_ +#define CEF_INCLUDE_CEF_PROXY_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" /// // Implement this interface to handle proxy resolution events. /// /*--cef(source=client)--*/ -class CefProxyHandler : public virtual CefBase -{ -public: +class CefProxyHandler : public virtual CefBase { + public: /// // Called to retrieve proxy information for the specified |url|. /// @@ -54,4 +54,4 @@ public: CefProxyInfo& proxy_info) {} }; -#endif // _CEF_PROXY_HANDLER_H +#endif // CEF_INCLUDE_CEF_PROXY_HANDLER_H_ diff --git a/include/cef_render_handler.h b/include/cef_render_handler.h index bfe92b0c4..f75a73d2e 100644 --- a/include/cef_render_handler.h +++ b/include/cef_render_handler.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_RENDER_HANDLER_H -#define _CEF_RENDER_HANDLER_H +#ifndef CEF_INCLUDE_CEF_RENDER_HANDLER_H_ +#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include class CefBrowser; @@ -47,9 +48,8 @@ class CefBrowser; // The methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefRenderHandler : public virtual CefBase -{ -public: +class CefRenderHandler : public virtual CefBase { + public: typedef cef_paint_element_type_t PaintElementType; typedef std::vector RectList; @@ -117,4 +117,4 @@ public: CefCursorHandle cursor) {} }; -#endif // _CEF_RENDER_HANDLER_H +#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_ diff --git a/include/cef_request.h b/include/cef_request.h index 6b092a1ce..95ade79b1 100644 --- a/include/cef_request.h +++ b/include/cef_request.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_REQUEST_H -#define _CEF_REQUEST_H +#ifndef CEF_INCLUDE_CEF_REQUEST_H_ +#define CEF_INCLUDE_CEF_REQUEST_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include #include @@ -49,10 +50,9 @@ class CefPostDataElement; // called on any thread. /// /*--cef(source=library)--*/ -class CefRequest : public virtual CefBase -{ -public: - typedef std::multimap HeaderMap; +class CefRequest : public virtual CefBase { + public: + typedef std::multimap HeaderMap; typedef cef_weburlrequest_flags_t RequestFlags; /// @@ -146,9 +146,8 @@ public: // class may be called on any thread. /// /*--cef(source=library)--*/ -class CefPostData : public virtual CefBase -{ -public: +class CefPostData : public virtual CefBase { + public: typedef std::vector > ElementVector; /// @@ -195,9 +194,8 @@ public: // methods of this class may be called on any thread. /// /*--cef(source=library)--*/ -class CefPostDataElement : public virtual CefBase -{ -public: +class CefPostDataElement : public virtual CefBase { + public: /// // Post data elements may represent either bytes or files. /// @@ -254,4 +252,4 @@ public: virtual size_t GetBytes(size_t size, void* bytes) =0; }; -#endif // _CEF_REQUEST_H +#endif // CEF_INCLUDE_CEF_REQUEST_H_ diff --git a/include/cef_request_handler.h b/include/cef_request_handler.h index 4f3d1ef14..9f178b082 100644 --- a/include/cef_request_handler.h +++ b/include/cef_request_handler.h @@ -34,15 +34,16 @@ // tools directory for more information. // -#ifndef _CEF_REQUEST_HANDLER_H -#define _CEF_REQUEST_HANDLER_H +#ifndef CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ +#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ +#pragma once -#include "cef_base.h" -#include "cef_download_handler.h" -#include "cef_content_filter.h" -#include "cef_response.h" -#include "cef_request.h" -#include "cef_stream.h" +#include "include/cef_base.h" +#include "include/cef_download_handler.h" +#include "include/cef_content_filter.h" +#include "include/cef_response.h" +#include "include/cef_request.h" +#include "include/cef_stream.h" class CefBrowser; class CefFrame; @@ -52,9 +53,8 @@ class CefFrame; // methods of this class will be called on the thread indicated. /// /*--cef(source=client)--*/ -class CefRequestHandler : public virtual CefBase -{ -public: +class CefRequestHandler : public virtual CefBase { + public: typedef cef_handler_navtype_t NavType; /// @@ -157,4 +157,4 @@ public: CefString& password) { return false; } }; -#endif // _CEF_REQUEST_HANDLER_H +#endif // CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ diff --git a/include/cef_response.h b/include/cef_response.h index 08862dd4d..5448cd71c 100644 --- a/include/cef_response.h +++ b/include/cef_response.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_RESPONSE_H -#define _CEF_RESPONSE_H +#ifndef CEF_INCLUDE_CEF_RESPONSE_H_ +#define CEF_INCLUDE_CEF_RESPONSE_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" #include /// @@ -45,10 +46,9 @@ // called on any thread. /// /*--cef(source=library)--*/ -class CefResponse : public virtual CefBase -{ -public: - typedef std::multimap HeaderMap; +class CefResponse : public virtual CefBase { + public: + typedef std::multimap HeaderMap; /// // Get the response status code. @@ -101,4 +101,4 @@ public: virtual void SetHeaderMap(const HeaderMap& headerMap) =0; }; -#endif // _CEF_RESPONSE_H +#endif // CEF_INCLUDE_CEF_RESPONSE_H_ diff --git a/include/cef_runnable.h b/include/cef_runnable.h index 81d630d54..826ddaa46 100644 --- a/include/cef_runnable.h +++ b/include/cef_runnable.h @@ -30,12 +30,12 @@ // // The contents of this file are a modified extract of base/task.h -#ifndef _CEF_RUNNABLE_H -#define _CEF_RUNNABLE_H +#ifndef CEF_INCLUDE_CEF_RUNNABLE_H_ +#define CEF_INCLUDE_CEF_RUNNABLE_H_ #pragma once -#include "cef_base.h" -#include "cef_task.h" +#include "include/cef_base.h" +#include "include/cef_task.h" #ifdef BUILDING_CEF_SHARED #include "base/tuple.h" #else @@ -343,4 +343,4 @@ inline CefRefPtr NewCefRunnableFunction(Function function, function, MakeTuple(a, b, c, d, e, f, g, h)); } -#endif // _CEF_RUNNABLE_H +#endif // CEF_INCLUDE_CEF_RUNNABLE_H_ diff --git a/include/cef_scheme.h b/include/cef_scheme.h index c4d3093c1..d031acec2 100644 --- a/include/cef_scheme.h +++ b/include/cef_scheme.h @@ -34,10 +34,11 @@ // tools directory for more information. // -#ifndef _CEF_SCHEME_H -#define _CEF_SCHEME_H +#ifndef CEF_INCLUDE_CEF_SCHEME_H_ +#define CEF_INCLUDE_CEF_SCHEME_H_ +#pragma once -#include "cef_base.h" +#include "include/cef_base.h" class CefBrowser; class CefRequest; @@ -48,12 +49,12 @@ class CefSchemeHandlerFactory; /// // Register a custom scheme. This method should not be called for the built-in // HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. -// +// // If |is_standard| is true the scheme will be treated as a standard scheme. // Standard schemes are subject to URL canonicalization and parsing rules as // defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available // at http://www.ietf.org/rfc/rfc1738.txt -// +// // In particular, the syntax for standard scheme URLs must be of the form: //
 //  [scheme]://[username]:[password]@[host]:[port]/[url-path]
@@ -66,12 +67,12 @@ class CefSchemeHandlerFactory;
 // both be canonicalized to "scheme://host/path". The origin of a standard
 // scheme URL is the combination of scheme, host and port (i.e.,
 // "scheme://host:port" in the most explicit case).
-// 
+//
 // For non-standard scheme URLs only the "scheme:" component is parsed and
 // canonicalized. The remainder of the URL will be passed to the handler as-is.
 // For example, "scheme:///some%20text" will remain the same. Non-standard
 // scheme URLs cannot be used as a target for form submission.
-// 
+//
 // If |is_local| is true the scheme will be treated as local (i.e., with the
 // same security rules as those applied to "file" URLs). Normal pages cannot
 // link to or access local URLs. Also, by default, local URLs can only perform
@@ -80,12 +81,12 @@ class CefSchemeHandlerFactory;
 // the same origin set the CefSettings.file_access_from_file_urls_allowed value
 // to true. To allow XMLHttpRequest calls from a local URL to all origins set
 // the CefSettings.universal_access_from_file_urls_allowed value to true.
-// 
+//
 // If |is_display_isolated| is true the scheme will be treated as display-
 // isolated. This means that pages cannot display these URLs unless they are
 // from the same scheme. For example, pages in another origin cannot create
 // iframes or hyperlinks to URLs with this scheme.
-// 
+//
 // This function may be called on any thread. It should only be called once
 // per unique |scheme_name| value. If |scheme_name| is already registered or if
 // an error occurs this method will return false.
@@ -126,9 +127,8 @@ bool CefClearSchemeHandlerFactories();
 // always be called on the IO thread.
 ///
 /*--cef(source=client)--*/
-class CefSchemeHandlerFactory : public virtual CefBase
-{
-public:
+class CefSchemeHandlerFactory : public virtual CefBase {
+ public:
   ///
   // Return a new scheme handler instance to handle the request. |browser| will
   // be the browser window that initiated the request. If the request was
@@ -145,9 +145,8 @@ public:
 // requests. The methods of this class may be called on any thread.
 ///
 /*--cef(source=library)--*/
-class CefSchemeHandlerCallback : public virtual CefBase
-{
-public:
+class CefSchemeHandlerCallback : public virtual CefBase {
+ public:
   ///
   // Notify that header information is now available for retrieval.
   ///
@@ -172,14 +171,13 @@ public:
 // this class will always be called on the IO thread.
 ///
 /*--cef(source=client)--*/
-class CefSchemeHandler : public virtual CefBase
-{
-public:
+class CefSchemeHandler : public virtual CefBase {
+ public:
   ///
   // Begin processing the request. To handle the request return true and call
   // HeadersAvailable() once the response header information is available
   // (HeadersAvailable() can also be called from inside this method if header
-  // information is available immediately). To cancel the request return false. 
+  // information is available immediately). To cancel the request return false.
   ///
   /*--cef()--*/
   virtual bool ProcessRequest(CefRefPtr request,
@@ -220,4 +218,4 @@ public:
   virtual void Cancel() =0;
 };
 
-#endif // _CEF_SCHEME_H
+#endif  // CEF_INCLUDE_CEF_SCHEME_H_
diff --git a/include/cef_storage.h b/include/cef_storage.h
index 928b6f9cd..869595159 100644
--- a/include/cef_storage.h
+++ b/include/cef_storage.h
@@ -34,10 +34,11 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_STORAGE_H
-#define _CEF_STORAGE_H
+#ifndef CEF_INCLUDE_CEF_STORAGE_H_
+#define CEF_INCLUDE_CEF_STORAGE_H_
+#pragma once
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 class CefStorageVisitor;
 
@@ -91,9 +92,8 @@ bool CefSetStoragePath(CefStorageType type, const CefString& path);
 // always be called on the UI thread.
 ///
 /*--cef(source=client)--*/
-class CefStorageVisitor : public virtual CefBase
-{
-public:
+class CefStorageVisitor : public virtual CefBase {
+ public:
   ///
   // Method that will be called once for each key/value data pair in storage.
   // |count| is the 0-based index for the current pair. |total| is the total
@@ -107,4 +107,4 @@ public:
                      int total, bool& deleteData) =0;
 };
 
-#endif // _CEF_STORAGE_H
+#endif  // CEF_INCLUDE_CEF_STORAGE_H_
diff --git a/include/cef_stream.h b/include/cef_stream.h
index e6b18b7f4..8daae1708 100644
--- a/include/cef_stream.h
+++ b/include/cef_stream.h
@@ -34,19 +34,18 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_STREAM_H
-#define _CEF_STREAM_H
+#ifndef CEF_INCLUDE_CEF_STREAM_H_
+#define CEF_INCLUDE_CEF_STREAM_H_
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 ///
 // Interface the client can implement to provide a custom stream reader. The
 // methods of this class may be called on any thread.
 ///
 /*--cef(source=client)--*/
-class CefReadHandler : public virtual CefBase
-{
-public:
+class CefReadHandler : public virtual CefBase {
+ public:
   ///
   // Read raw binary data.
   ///
@@ -55,16 +54,17 @@ public:
 
   ///
   // Seek to the specified offset position. |whence| may be any one of
-  // SEEK_CUR, SEEK_END or SEEK_SET.
+  // SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
+  // failure.
   ///
   /*--cef()--*/
-  virtual int Seek(long offset, int whence) =0;
+  virtual int Seek(int64 offset, int whence) =0;
 
   ///
   // Return the current offset position.
   ///
   /*--cef()--*/
-  virtual long Tell() =0;
+  virtual int64 Tell() =0;
 
   ///
   // Return non-zero if at end of file.
@@ -79,9 +79,8 @@ public:
 // called on any thread.
 ///
 /*--cef(source=library)--*/
-class CefStreamReader : public virtual CefBase
-{
-public:
+class CefStreamReader : public virtual CefBase {
+ public:
   ///
   // Create a new CefStreamReader object from a file.
   ///
@@ -111,13 +110,13 @@ public:
   // failure.
   ///
   /*--cef()--*/
-  virtual int Seek(long offset, int whence) =0;
+  virtual int Seek(int64 offset, int whence) =0;
 
   ///
   // Return the current offset position.
   ///
   /*--cef()--*/
-  virtual long Tell() =0;
+  virtual int64 Tell() =0;
 
   ///
   // Return non-zero if at end of file.
@@ -132,9 +131,8 @@ public:
 // methods of this class may be called on any thread.
 ///
 /*--cef(source=client)--*/
-class CefWriteHandler : public virtual CefBase
-{
-public:
+class CefWriteHandler : public virtual CefBase {
+ public:
   ///
   // Write raw binary data.
   ///
@@ -143,16 +141,17 @@ public:
 
   ///
   // Seek to the specified offset position. |whence| may be any one of
-  // SEEK_CUR, SEEK_END or SEEK_SET.
+  // SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
+  // failure.
   ///
   /*--cef()--*/
-  virtual int Seek(long offset, int whence) =0;
+  virtual int Seek(int64 offset, int whence) =0;
 
   ///
   // Return the current offset position.
   ///
   /*--cef()--*/
-  virtual long Tell() =0;
+  virtual int64 Tell() =0;
 
   ///
   // Flush the stream.
@@ -167,9 +166,8 @@ public:
 // on any thread.
 ///
 /*--cef(source=library)--*/
-class CefStreamWriter : public virtual CefBase
-{
-public:
+class CefStreamWriter : public virtual CefBase {
+ public:
   ///
   // Create a new CefStreamWriter object for a file.
   ///
@@ -187,19 +185,20 @@ public:
   ///
   /*--cef()--*/
   virtual size_t Write(const void* ptr, size_t size, size_t n) =0;
-	
+
   ///
   // Seek to the specified offset position. |whence| may be any one of
-  // SEEK_CUR, SEEK_END or SEEK_SET.
+  // SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
+  // failure.
   ///
   /*--cef()--*/
-  virtual int Seek(long offset, int whence) =0;
-	
+  virtual int Seek(int64 offset, int whence) =0;
+
   ///
   // Return the current offset position.
   ///
   /*--cef()--*/
-  virtual long Tell() =0;
+  virtual int64 Tell() =0;
 
   ///
   // Flush the stream.
@@ -208,4 +207,4 @@ public:
   virtual int Flush() =0;
 };
 
-#endif // _CEF_STREAM_H
+#endif  // CEF_INCLUDE_CEF_STREAM_H_
diff --git a/include/cef_task.h b/include/cef_task.h
index e3a9ecc87..86550f6a0 100644
--- a/include/cef_task.h
+++ b/include/cef_task.h
@@ -34,10 +34,10 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_TASK_H
-#define _CEF_TASK_H
+#ifndef CEF_INCLUDE_CEF_TASK_H_
+#define CEF_INCLUDE_CEF_TASK_H_
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 class CefTask;
 
@@ -69,7 +69,7 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr task);
 ///
 /*--cef()--*/
 bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task,
-                        long delay_ms);
+                        int64 delay_ms);
 
 
 ///
@@ -77,9 +77,8 @@ bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task,
 // be called on any thread.
 ///
 /*--cef(source=client)--*/
-class CefTask : public virtual CefBase
-{
-public:
+class CefTask : public virtual CefBase {
+ public:
   ///
   // Method that will be executed. |threadId| is the thread executing the call.
   ///
@@ -87,4 +86,4 @@ public:
   virtual void Execute(CefThreadId threadId) =0;
 };
 
-#endif // _CEF_TASK_H
+#endif  // CEF_INCLUDE_CEF_TASK_H_
diff --git a/include/cef_url.h b/include/cef_url.h
index bf7109ab4..6caa1e229 100644
--- a/include/cef_url.h
+++ b/include/cef_url.h
@@ -34,10 +34,11 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_URL_H
-#define _CEF_URL_H
+#ifndef CEF_INCLUDE_CEF_URL_H_
+#define CEF_INCLUDE_CEF_URL_H_
+#pragma once
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 ///
 // Parse the specified |url| into its component parts.
@@ -56,4 +57,4 @@ bool CefParseURL(const CefString& url,
 bool CefCreateURL(const CefURLParts& parts,
                   CefString& url);
 
-#endif // _CEF_URL_H
+#endif  // CEF_INCLUDE_CEF_URL_H_
diff --git a/include/cef_v8.h b/include/cef_v8.h
index 0862de481..0288b732d 100644
--- a/include/cef_v8.h
+++ b/include/cef_v8.h
@@ -35,10 +35,11 @@
 //
 
 
-#ifndef _CEF_V8_H
-#define _CEF_V8_H
+#ifndef CEF_INCLUDE_CEF_V8_H_
+#define CEF_INCLUDE_CEF_V8_H_
+#pragma once
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 #include 
 
 class CefBrowser;
@@ -53,7 +54,7 @@ class CefV8Value;
 // keyword 'native'. The calling of a native function is restricted to the scope
 // in which the prototype of the native function is defined. This function may
 // be called on any thread.
-// 
+//
 // Example JavaScript extension code:
 // 
 //   // create the 'example' global object if it doesn't already exist.
@@ -116,9 +117,8 @@ bool CefRegisterExtension(const CefString& extension_name,
 // Class that encapsulates a V8 context handle.
 ///
 /*--cef(source=library)--*/
-class CefV8Context : public virtual CefBase
-{
-public:
+class CefV8Context : public virtual CefBase {
+ public:
   ///
   // Returns the current (top) context object in the V8 context stack.
   ///
@@ -188,9 +188,8 @@ typedef std::vector > CefV8ValueList;
 // of this class will always be called on the UI thread.
 ///
 /*--cef(source=client)--*/
-class CefV8Handler : public virtual CefBase
-{
-public:
+class CefV8Handler : public virtual CefBase {
+ public:
   ///
   // Handle execution of the function identified by |name|. |object| is the
   // receiver ('this' object) of the function. |arguments| is the list of
@@ -212,9 +211,8 @@ public:
 // of this class will always be called on the UI thread.
 ///
 /*--cef(source=client)--*/
-class CefV8Accessor : public virtual CefBase
-{
-public:
+class CefV8Accessor : public virtual CefBase {
+ public:
   ///
   // Handle retrieval the accessor value identified by |name|. |object| is the
   // receiver ('this' object) of the accessor. If retrieval succeeds set
@@ -246,9 +244,8 @@ public:
 // Class representing a V8 exception.
 ///
 /*--cef(source=library)--*/
-class CefV8Exception : public virtual CefBase
-{
-public:
+class CefV8Exception : public virtual CefBase {
+ public:
   ///
   // Returns the exception message.
   ///
@@ -309,9 +306,8 @@ public:
 // called on the UI thread.
 ///
 /*--cef(source=library)--*/
-class CefV8Value : public virtual CefBase
-{
-public:
+class CefV8Value : public virtual CefBase {
+ public:
   typedef cef_v8_accesscontrol_t AccessControl;
   typedef cef_v8_propertyattribute_t PropertyAttribute;
 
@@ -359,7 +355,7 @@ public:
   ///
   /*--cef(capi_name=cef_v8value_create_object_with_accessor,
           optional_param=user_data,optional_param=accessor)--*/
-  static CefRefPtr CreateObject(CefRefPtr user_data, 
+  static CefRefPtr CreateObject(CefRefPtr user_data,
                                             CefRefPtr accessor);
   ///
   // Create a new CefV8Value object of type array. This method should only be
@@ -436,7 +432,7 @@ public:
   ///
   /*--cef()--*/
   virtual bool IsSame(CefRefPtr that) =0;
-  
+
   ///
   // Return a bool value.  The underlying data will be converted to if
   // necessary.
@@ -523,7 +519,7 @@ public:
   // instance passed to CefV8Value::CreateObject().
   ///
   /*--cef(capi_name=set_value_byaccessor)--*/
-  virtual bool SetValue(const CefString& key, AccessControl settings, 
+  virtual bool SetValue(const CefString& key, AccessControl settings,
                         PropertyAttribute attribute) =0;
 
   ///
@@ -587,7 +583,7 @@ public:
   // arguments that will be passed to the function. If execution succeeds
   // |retval| will be set to the function return value. If execution fails
   // |exception| will be set to the exception that was thrown. If
-  // |rethrow_exception| is true any exception will also be re-thrown. This 
+  // |rethrow_exception| is true any exception will also be re-thrown. This
   // method returns false if called incorrectly.
   ///
   /*--cef(optional_param=object)--*/
@@ -599,4 +595,4 @@ public:
                                           bool rethrow_exception) =0;
 };
 
-#endif // _CEF_V8_H
+#endif  // CEF_INCLUDE_CEF_V8_H_
diff --git a/include/cef_v8context_handler.h b/include/cef_v8context_handler.h
index e46cefc4d..ff77f9b64 100644
--- a/include/cef_v8context_handler.h
+++ b/include/cef_v8context_handler.h
@@ -34,11 +34,12 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_V8CONTEXT_HANDLER_H
-#define _CEF_V8CONTEXT_HANDLER_H
+#ifndef CEF_INCLUDE_CEF_V8CONTEXT_HANDLER_H_
+#define CEF_INCLUDE_CEF_V8CONTEXT_HANDLER_H_
+#pragma once
 
-#include "cef_base.h"
-#include "cef_v8.h"
+#include "include/cef_base.h"
+#include "include/cef_v8.h"
 
 class CefBrowser;
 class CefFrame;
@@ -48,9 +49,8 @@ class CefFrame;
 // class will be called on the UI thread.
 ///
 /*--cef(source=client)--*/
-class CefV8ContextHandler : public virtual CefBase
-{
-public:
+class CefV8ContextHandler : public virtual CefBase {
+ public:
   ///
   // Called immediately after the V8 context for a frame has been created. To
   // retrieve the JavaScript 'window' object use the CefV8Context::GetGlobal()
@@ -71,4 +71,4 @@ public:
                                  CefRefPtr context) {}
 };
 
-#endif // _CEF_V8CONTEXT_HANDLER_H
+#endif  // CEF_INCLUDE_CEF_V8CONTEXT_HANDLER_H_
diff --git a/include/cef_web_urlrequest.h b/include/cef_web_urlrequest.h
index 46a92d651..9b3be1cf2 100644
--- a/include/cef_web_urlrequest.h
+++ b/include/cef_web_urlrequest.h
@@ -34,10 +34,11 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_WEB_URLREQUEST_H
-#define _CEF_WEB_URLREQUEST_H
+#ifndef CEF_INCLUDE_CEF_WEB_URLREQUEST_H_
+#define CEF_INCLUDE_CEF_WEB_URLREQUEST_H_
+#pragma once
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 class CefRequest;
 class CefResponse;
@@ -49,9 +50,8 @@ class CefWebURLRequestClient;
 // methods of this class may be called on any thread.
 ///
 /*--cef(source=library)--*/
-class CefWebURLRequest : public virtual CefBase
-{
-public:
+class CefWebURLRequest : public virtual CefBase {
+ public:
   typedef cef_weburlrequest_state_t RequestState;
 
   ///
@@ -59,7 +59,7 @@ public:
   ///
   /*--cef()--*/
   static CefRefPtr CreateWebURLRequest(
-      CefRefPtr request, 
+      CefRefPtr request,
       CefRefPtr client);
 
   ///
@@ -80,19 +80,18 @@ public:
 // methods of this class will always be called on the UI thread.
 ///
 /*--cef(source=client)--*/
-class CefWebURLRequestClient : public virtual CefBase
-{
-public:
+class CefWebURLRequestClient : public virtual CefBase {
+ public:
   typedef cef_weburlrequest_state_t RequestState;
   typedef cef_handler_errorcode_t ErrorCode;
-  
+
   ///
   // Notifies the client that the request state has changed. State change
   // notifications will always be sent before the below notification methods
   // are called.
   ///
   /*--cef()--*/
-  virtual void OnStateChange(CefRefPtr requester, 
+  virtual void OnStateChange(CefRefPtr requester,
                              RequestState state) =0;
 
   ///
@@ -100,8 +99,8 @@ public:
   // chance to change the request parameters.
   ///
   /*--cef()--*/
-  virtual void OnRedirect(CefRefPtr requester, 
-                          CefRefPtr request, 
+  virtual void OnRedirect(CefRefPtr requester,
+                          CefRefPtr request,
                           CefRefPtr response) =0;
 
   ///
@@ -115,22 +114,22 @@ public:
   // Notifies the client of the upload progress.
   ///
   /*--cef()--*/
-  virtual void OnProgress(CefRefPtr requester, 
+  virtual void OnProgress(CefRefPtr requester,
                           uint64 bytesSent, uint64 totalBytesToBeSent) =0;
 
   ///
   // Notifies the client that content has been received.
   ///
   /*--cef()--*/
-  virtual void OnData(CefRefPtr requester, 
+  virtual void OnData(CefRefPtr requester,
                       const void* data, int dataLength) =0;
 
   ///
   // Notifies the client that the request ended with an error.
   ///
   /*--cef()--*/
-  virtual void OnError(CefRefPtr requester, 
+  virtual void OnError(CefRefPtr requester,
                        ErrorCode errorCode) =0;
 };
 
-#endif // _CEF_WEB_URLREQUEST_H
+#endif  // CEF_INCLUDE_CEF_WEB_URLREQUEST_H_
diff --git a/include/cef_xml_reader.h b/include/cef_xml_reader.h
index 5791883e0..781e0daca 100644
--- a/include/cef_xml_reader.h
+++ b/include/cef_xml_reader.h
@@ -34,10 +34,11 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_XML_READER_H
-#define _CEF_XML_READER_H
+#ifndef CEF_INCLUDE_CEF_XML_READER_H_
+#define CEF_INCLUDE_CEF_XML_READER_H_
+#pragma once
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 class CefStreamReader;
 
@@ -47,9 +48,8 @@ class CefStreamReader;
 // the object.
 ///
 /*--cef(source=library)--*/
-class CefXmlReader : public virtual CefBase
-{
-public:
+class CefXmlReader : public virtual CefBase {
+ public:
   typedef cef_xml_encoding_type_t EncodingType;
   typedef cef_xml_node_type_t NodeType;
 
@@ -266,4 +266,4 @@ public:
   virtual bool MoveToCarryingElement() =0;
 };
 
-#endif // _CEF_XML_READER_H
+#endif  // CEF_INCLUDE_CEF_XML_READER_H_
diff --git a/include/cef_zip_reader.h b/include/cef_zip_reader.h
index 79a72c28d..f417b62b4 100644
--- a/include/cef_zip_reader.h
+++ b/include/cef_zip_reader.h
@@ -34,10 +34,10 @@
 // tools directory for more information.
 //
 
-#ifndef _CEF_ZIP_READER_H
-#define _CEF_ZIP_READER_H
+#ifndef CEF_INCLUDE_CEF_ZIP_READER_H_
+#define CEF_INCLUDE_CEF_ZIP_READER_H_
 
-#include "cef_base.h"
+#include "include/cef_base.h"
 
 class CefStreamReader;
 
@@ -47,9 +47,8 @@ class CefStreamReader;
 // the object.
 ///
 /*--cef(source=library)--*/
-class CefZipReader : public virtual CefBase
-{
-public:
+class CefZipReader : public virtual CefBase {
+ public:
   ///
   // Create a new CefZipReader object. The returned object's methods can only
   // be called from the thread that created the object.
@@ -74,7 +73,7 @@ public:
   ///
   // Moves the cursor to the specified file in the archive. If |caseSensitive|
   // is true then the search will be case sensitive. Returns true if the cursor
-  // position was set successfully. 
+  // position was set successfully.
   ///
   /*--cef()--*/
   virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0;
@@ -99,7 +98,7 @@ public:
   // Returns the uncompressed size of the file.
   ///
   /*--cef()--*/
-  virtual long GetFileSize() =0;
+  virtual int64 GetFileSize() =0;
 
   ///
   // Returns the last modified timestamp for the file.
@@ -131,7 +130,7 @@ public:
   // Returns the current offset in the uncompressed file contents.
   ///
   /*--cef()--*/
-  virtual long Tell() =0;
+  virtual int64 Tell() =0;
 
   ///
   // Returns true if at end of the file contents.
@@ -140,4 +139,4 @@ public:
   virtual bool Eof() =0;
 };
 
-#endif // _CEF_ZIP_READER_H
+#endif  // CEF_INCLUDE_CEF_ZIP_READER_H_
diff --git a/include/internal/cef_build.h b/include/internal/cef_build.h
index cbe4851a7..4b8c54546 100644
--- a/include/internal/cef_build.h
+++ b/include/internal/cef_build.h
@@ -28,14 +28,15 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_BUILD_H
-#define _CEF_BUILD_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_BUILD_H_
+#define CEF_INCLUDE_INTERNAL_CEF_BUILD_H_
+#pragma once
 
 #if defined(BUILDING_CEF_SHARED)
 
 #include "base/compiler_specific.h"
 
-#else // !BUILDING_CEF_SHARED
+#else  // !BUILDING_CEF_SHARED
 
 #if defined(_WIN32)
 #ifndef OS_WIN
@@ -116,13 +117,13 @@
 #define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \
                                              code \
                                              MSVC_POP_WARNING()
-#else // !COMPILER_MSVC
+#else  // !COMPILER_MSVC
 
 #define ALLOW_THIS_IN_INITIALIZER_LIST(code) code
 
-#endif // !COMPILER_MSVC
+#endif  // !COMPILER_MSVC
 #endif
 
-#endif // !BUILDING_CEF_SHARED
+#endif  // !BUILDING_CEF_SHARED
 
-#endif // _CEF_BUILD_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_BUILD_H_
diff --git a/include/internal/cef_export.h b/include/internal/cef_export.h
index 3a56adaf3..d333a5db8 100644
--- a/include/internal/cef_export.h
+++ b/include/internal/cef_export.h
@@ -28,10 +28,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_EXPORT_H
-#define _CEF_EXPORT_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
+#define CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
+#pragma once
 
-#include "cef_build.h"
+#include "include/internal/cef_build.h"
 
 #if defined(COMPILER_MSVC)
 
@@ -51,4 +52,4 @@
 
 #endif  // COMPILER_GCC
 
-#endif // _CEF_EXPORT_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
diff --git a/include/internal/cef_linux.h b/include/internal/cef_linux.h
index 1f59468f1..b53c2341c 100644
--- a/include/internal/cef_linux.h
+++ b/include/internal/cef_linux.h
@@ -28,45 +28,39 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_LINUX_H
-#define _CEF_LINUX_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_LINUX_H_
+#define CEF_INCLUDE_INTERNAL_CEF_LINUX_H_
+#pragma once
 
 #if defined(OS_LINUX)
 #include 
-#include "cef_types_linux.h"
-#include "cef_types_wrappers.h"
+#include "include/internal/cef_types_linux.h"
+#include "include/internal/cef_types_wrappers.h"
 
 // Atomic increment and decrement.
-inline long CefAtomicIncrement(long volatile *pDest)
-{
+inline long CefAtomicIncrement(long volatile *pDest) {  // NOLINT(runtime/int)
   return __sync_add_and_fetch(pDest, 1);
 }
-inline long CefAtomicDecrement(long volatile *pDest)
-{
+inline long CefAtomicDecrement(long volatile *pDest) {  // NOLINT(runtime/int)
   return __sync_sub_and_fetch(pDest, 1);
 }
 
 // Critical section wrapper.
-class CefCriticalSection
-{
-public:
-  CefCriticalSection()
-  {
+class CefCriticalSection {
+ public:
+  CefCriticalSection() {
     pthread_mutexattr_init(&attr_);
     pthread_mutexattr_settype(&attr_, PTHREAD_MUTEX_RECURSIVE);
     pthread_mutex_init(&lock_, &attr_);
   }
-  virtual ~CefCriticalSection()
-  {
+  virtual ~CefCriticalSection() {
     pthread_mutex_destroy(&lock_);
     pthread_mutexattr_destroy(&attr_);
   }
-  void Lock()
-  {
+  void Lock() {
     pthread_mutex_lock(&lock_);
   }
-  void Unlock()
-  {
+  void Unlock() {
     pthread_mutex_unlock(&lock_);
   }
 
@@ -84,25 +78,23 @@ struct CefWindowInfoTraits {
   static inline void init(struct_type* s) {}
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->m_Widget = src->m_Widget;
     target->m_ParentWidget = src->m_ParentWidget;
   }
 };
 
 // Class representing window information.
-class CefWindowInfo : public CefStructBase
-{
-public:
+class CefWindowInfo : public CefStructBase {
+ public:
   typedef CefStructBase parent;
 
   CefWindowInfo() : parent() {}
-  CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
-  CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
-  
-  void SetAsChild(CefWindowHandle ParentWidget)
-  {
+  explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
+  explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
+
+  void SetAsChild(CefWindowHandle ParentWidget) {
     m_ParentWidget = ParentWidget;
   }
 };
@@ -113,8 +105,8 @@ struct CefPrintInfoTraits {
   static inline void init(struct_type* s) {}
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->m_Scale = src->m_Scale;
   }
 };
@@ -122,6 +114,6 @@ struct CefPrintInfoTraits {
 // Class representing print context information.
 typedef CefStructBase CefPrintInfo;
 
-#endif // OS_LINUX
+#endif  // OS_LINUX
 
-#endif // _CEF_LINUX_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_LINUX_H_
diff --git a/include/internal/cef_mac.h b/include/internal/cef_mac.h
index b949343af..532ade4f9 100644
--- a/include/internal/cef_mac.h
+++ b/include/internal/cef_mac.h
@@ -28,21 +28,20 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_MAC_H
-#define _CEF_MAC_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_MAC_H_
+#define CEF_INCLUDE_INTERNAL_CEF_MAC_H_
+#pragma once
 
 #if defined(OS_MACOSX)
 #include 
-#include "cef_types_mac.h"
-#include "cef_types_wrappers.h"
+#include "include/internal/cef_types_mac.h"
+#include "include/internal/cef_types_wrappers.h"
 
 // Atomic increment and decrement.
-inline long CefAtomicIncrement(long volatile *pDest)
-{
+inline long CefAtomicIncrement(long volatile *pDest) {  // NOLINT(runtime/int)
   return __sync_add_and_fetch(pDest, 1);
 }
-inline long CefAtomicDecrement(long volatile *pDest)
-{
+inline long CefAtomicDecrement(long volatile *pDest) {  // NOLINT(runtime/int)
   return __sync_sub_and_fetch(pDest, 1);
 }
 
@@ -51,26 +50,21 @@ inline long CefAtomicDecrement(long volatile *pDest)
 #define CefCursorHandle cef_cursor_handle_t
 
 // Critical section wrapper.
-class CefCriticalSection
-{
-public:
-  CefCriticalSection()
-  {
+class CefCriticalSection {
+ public:
+  CefCriticalSection() {
     pthread_mutexattr_init(&attr_);
     pthread_mutexattr_settype(&attr_, PTHREAD_MUTEX_RECURSIVE);
     pthread_mutex_init(&lock_, &attr_);
   }
-  virtual ~CefCriticalSection()
-  {
+  virtual ~CefCriticalSection() {
     pthread_mutex_destroy(&lock_);
     pthread_mutexattr_destroy(&attr_);
   }
-  void Lock()
-  {
+  void Lock() {
     pthread_mutex_lock(&lock_);
   }
-  void Unlock()
-  {
+  void Unlock() {
     pthread_mutex_unlock(&lock_);
   }
 
@@ -83,13 +77,12 @@ struct CefWindowInfoTraits {
 
   static inline void init(struct_type* s) {}
 
-  static inline void clear(struct_type* s)
-  {
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->m_windowName);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->m_View = src->m_View;
     target->m_ParentView = src->m_ParentView;
     cef_string_set(src->m_windowName.str, src->m_windowName.length,
@@ -103,18 +96,16 @@ struct CefWindowInfoTraits {
 };
 
 // Class representing window information.
-class CefWindowInfo : public CefStructBase
-{
-public:
+class CefWindowInfo : public CefStructBase {
+ public:
   typedef CefStructBase parent;
 
   CefWindowInfo() : parent() {}
-  CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
-  CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
-  
+  explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
+  explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
+
   void SetAsChild(CefWindowHandle ParentView, int x, int y, int width,
-                  int height)
-  {
+                  int height) {
     m_ParentView = ParentView;
     m_x = x;
     m_y = y;
@@ -130,8 +121,8 @@ struct CefPrintInfoTraits {
   static inline void init(struct_type* s) {}
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->m_Scale = src->m_Scale;
   }
 };
@@ -139,6 +130,6 @@ struct CefPrintInfoTraits {
 // Class representing print context information.
 typedef CefStructBase CefPrintInfo;
 
-#endif // OS_MACOSX
+#endif  // OS_MACOSX
 
-#endif // _CEF_MAC_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_MAC_H_
diff --git a/include/internal/cef_nplugin_types.h b/include/internal/cef_nplugin_types.h
index 21a09e53e..0113f72fb 100644
--- a/include/internal/cef_nplugin_types.h
+++ b/include/internal/cef_nplugin_types.h
@@ -28,11 +28,12 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_NPLUGIN_TYPES_H
-#define _CEF_NPLUGIN_TYPES_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_NPLUGIN_TYPES_H_
+#define CEF_INCLUDE_INTERNAL_CEF_NPLUGIN_TYPES_H_
+#pragma once
 
-#include "cef_export.h"
-#include "cef_string.h"
+#include "include/internal/cef_export.h"
+#include "include/internal/cef_string.h"
 #include "third_party/npapi/bindings/npapi.h"
 #include "third_party/npapi/bindings/nphostapi.h"
 
@@ -61,15 +62,15 @@ typedef struct _cef_plugin_info_t {
 
   // A description of the plugin.
   cef_string_t description;
-  
+
   // A pipe (|) delimited list of mime type values that the plugin supports.
   cef_string_t mime_types;
-  
+
   // A pipe (|) delimited list of extension values. Each value is associated
   // with the mime type value at the same position. Multiple file extensions
   // for the same mime type may be delimited with commas (,).
   cef_string_t file_extensions;
-  
+
   // A pipe (|) delimited list of description values. Each value is associated
   // with the mime type value at the same position.
   cef_string_t type_descriptions;
@@ -86,4 +87,4 @@ typedef struct _cef_plugin_info_t {
 }
 #endif
 
-#endif // _CEF_NPLUGIN_TYPES_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_NPLUGIN_TYPES_H_
diff --git a/include/internal/cef_ptr.h b/include/internal/cef_ptr.h
index 472e02012..fcbe69e5c 100644
--- a/include/internal/cef_ptr.h
+++ b/include/internal/cef_ptr.h
@@ -29,8 +29,9 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_PTR_H
-#define _CEF_PTR_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_PTR_H_
+#define CEF_INCLUDE_INTERNAL_CEF_PTR_H_
+#pragma once
 
 #include 
 
@@ -148,7 +149,7 @@ class CefRefPtr {
   CefRefPtr() : ptr_(NULL) {
   }
 
-  CefRefPtr(T* p) : ptr_(p) {
+  CefRefPtr(T* p) : ptr_(p) {  // NOLINT(runtime/explicit)
     if (ptr_)
       ptr_->AddRef();
   }
@@ -188,11 +189,11 @@ class CefRefPtr {
   }
 
   void swap(CefRefPtr& r) {
-    swap(&r.ptr_);
+    swap(&r.ptr_);  // NOLINT(build/include_what_you_use)
   }
 
  private:
   T* ptr_;
 };
 
-#endif // _CEF_PTR_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_PTR_H_
diff --git a/include/internal/cef_string.h b/include/internal/cef_string.h
index 75db22b5e..a7876fe56 100644
--- a/include/internal/cef_string.h
+++ b/include/internal/cef_string.h
@@ -27,27 +27,28 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_STRING_H
-#define _CEF_STRING_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_H_
+#define CEF_INCLUDE_INTERNAL_CEF_STRING_H_
+#pragma once
 
 // The CEF interface is built with one string type as the default. Comment out
 // all but one of the CEF_STRING_TYPE_* defines below to specify the default.
 // If you change the default you MUST recompile all of CEF.
 
 // Build with the UTF8 string type as default.
-//#define CEF_STRING_TYPE_UTF8 1
+// #define CEF_STRING_TYPE_UTF8 1
 
 // Build with the UTF16 string type as default.
 #define CEF_STRING_TYPE_UTF16 1
 
 // Build with the wide string type as default.
-//#define CEF_STRING_TYPE_WIDE 1
+// #define CEF_STRING_TYPE_WIDE 1
 
 
-#include "cef_string_types.h"
+#include "include/internal/cef_string_types.h"
 
 #ifdef __cplusplus
-#include "cef_string_wrappers.h"
+#include "include/internal/cef_string_wrappers.h"
 #if defined(CEF_STRING_TYPE_UTF16)
 typedef CefStringUTF16 CefString;
 #elif defined(CEF_STRING_TYPE_UTF8)
@@ -55,7 +56,7 @@ typedef CefStringUTF8 CefString;
 #elif defined(CEF_STRING_TYPE_WIDE)
 typedef CefStringWide CefString;
 #endif
-#endif // __cplusplus
+#endif  // __cplusplus
 
 #if defined(CEF_STRING_TYPE_UTF8)
 typedef char cef_char_t;
@@ -109,4 +110,4 @@ typedef cef_string_userfree_wide_t cef_string_userfree_t;
 #error Please choose a string type.
 #endif
 
-#endif // _CEF_STRING_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_STRING_H_
diff --git a/include/internal/cef_string_list.h b/include/internal/cef_string_list.h
index fef0a97cc..52a0abf2f 100644
--- a/include/internal/cef_string_list.h
+++ b/include/internal/cef_string_list.h
@@ -27,11 +27,12 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_STRING_LIST_H
-#define _CEF_STRING_LIST_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_
+#define CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_
+#pragma once
 
-#include "cef_export.h"
-#include "cef_string.h"
+#include "include/internal/cef_export.h"
+#include "include/internal/cef_string.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -84,4 +85,4 @@ CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list);
 }
 #endif
 
-#endif // _CEF_STRING_LIST_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_
diff --git a/include/internal/cef_string_map.h b/include/internal/cef_string_map.h
index e20f824a1..93eea2a55 100644
--- a/include/internal/cef_string_map.h
+++ b/include/internal/cef_string_map.h
@@ -27,11 +27,12 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_STRING_MAP_H
-#define _CEF_STRING_MAP_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_
+#define CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_
+#pragma once
 
-#include "cef_export.h"
-#include "cef_string.h"
+#include "include/internal/cef_export.h"
+#include "include/internal/cef_string.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -93,4 +94,4 @@ CEF_EXPORT void cef_string_map_free(cef_string_map_t map);
 }
 #endif
 
-#endif // _CEF_STRING_MAP_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_
diff --git a/include/internal/cef_string_multimap.h b/include/internal/cef_string_multimap.h
index e99ae9a48..cd3904244 100644
--- a/include/internal/cef_string_multimap.h
+++ b/include/internal/cef_string_multimap.h
@@ -27,11 +27,12 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_STRING_MULTIMAP_H
-#define _CEF_STRING_MULTIMAP_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
+#define CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
+#pragma once
 
-#include "cef_export.h"
-#include "cef_string.h"
+#include "include/internal/cef_export.h"
+#include "include/internal/cef_string.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -101,4 +102,4 @@ CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map);
 }
 #endif
 
-#endif // _CEF_STRING_MULTIMAP_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
diff --git a/include/internal/cef_string_types.h b/include/internal/cef_string_types.h
index f71ffed6c..7ab6671cb 100644
--- a/include/internal/cef_string_types.h
+++ b/include/internal/cef_string_types.h
@@ -27,8 +27,9 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_STRING_TYPES_T
-#define _CEF_STRING_TYPES_T
+#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
+#define CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
+#pragma once
 
 // CEF provides functions for converting between UTF-8, -16 and -32 strings.
 // CEF string types are safe for reading from multiple threads but not for
@@ -39,8 +40,8 @@
 extern "C" {
 #endif
 
-#include "cef_build.h"
-#include "cef_export.h"
+#include "include/internal/cef_build.h"
+#include "include/internal/cef_export.h"
 #include 
 
 // CEF character type definitions. wchar_t is 2 bytes on Windows and 4 bytes on
@@ -48,12 +49,12 @@ extern "C" {
 
 #if defined(OS_WIN)
 typedef wchar_t char16;
-#else // !OS_WIN
-typedef unsigned short char16;
+#else  // !OS_WIN
+typedef unsigned short char16;  // NOLINT (runtime/int)
 #ifndef WCHAR_T_IS_UTF32
 #define WCHAR_T_IS_UTF32
-#endif // WCHAR_T_IS_UTF32
-#endif // !OS_WIN
+#endif  // WCHAR_T_IS_UTF32
+#endif  // !OS_WIN
 
 
 // CEF string type definitions. Whomever allocates |str| is responsible for
@@ -200,4 +201,4 @@ CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str);
 }
 #endif
 
-#endif // _CEF_STRING_TYPES_T
+#endif  // CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_
diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h
index 06fc42697..e6b29ebb4 100644
--- a/include/internal/cef_string_wrappers.h
+++ b/include/internal/cef_string_wrappers.h
@@ -27,15 +27,18 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_STRING_WRAPPERS_H
-#define _CEF_STRING_WRAPPERS_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
+#define CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
+#pragma once
+
+#include 
+#include 
+#include "include/internal/cef_string_types.h"
 
-#include "cef_string_types.h"
 #ifdef BUILDING_CEF_SHARED
 #include "base/string16.h"
 #endif
-#include 
-#include 
+
 
 ///
 // Traits implementation for wide character strings.
@@ -44,25 +47,27 @@ struct CefStringTraitsWide {
   typedef wchar_t char_type;
   typedef cef_string_wide_t struct_type;
   typedef cef_string_userfree_wide_t userfree_struct_type;
-  
+
   static inline void clear(struct_type *s) { cef_string_wide_clear(s); }
   static inline int set(const char_type* src, size_t src_size,
-                        struct_type *output, int copy)
-    { return cef_string_wide_set(src, src_size, output, copy); }
-  static inline int compare(const struct_type* s1, const struct_type* s2)
-    { return cef_string_wide_cmp(s1, s2); }
-  static inline userfree_struct_type userfree_alloc()
-    { return cef_string_userfree_wide_alloc(); }
-  static inline void userfree_free(userfree_struct_type ufs)
-    { return cef_string_userfree_wide_free(ufs); }
+                        struct_type* output, int copy) {
+    return cef_string_wide_set(src, src_size, output, copy);
+  }
+  static inline int compare(const struct_type* s1, const struct_type* s2) {
+    return cef_string_wide_cmp(s1, s2);
+  }
+  static inline userfree_struct_type userfree_alloc() {
+    return cef_string_userfree_wide_alloc();
+  }
+  static inline void userfree_free(userfree_struct_type ufs) {
+    return cef_string_userfree_wide_free(ufs);
+  }
 
   // Conversion methods.
-  static inline bool from_ascii(const char* str, size_t len, struct_type *s)
-  {
+  static inline bool from_ascii(const char* str, size_t len, struct_type *s) {
     return cef_string_ascii_to_wide(str, len, s) ? true : false;
   }
-  static inline std::string to_string(const struct_type *s)
-  {
+  static inline std::string to_string(const struct_type *s) {
     cef_string_utf8_t cstr;
     memset(&cstr, 0, sizeof(cstr));
     cef_string_wide_to_utf8(s->str, s->length, &cstr);
@@ -72,23 +77,19 @@ struct CefStringTraitsWide {
     cef_string_utf8_clear(&cstr);
     return str;
   }
-  static inline bool from_string(const std::string& str, struct_type *s)
-  {
+  static inline bool from_string(const std::string& str, struct_type *s) {
     return cef_string_utf8_to_wide(str.c_str(), str.length(), s) ? true : false;
   }
-  static inline std::wstring to_wstring(const struct_type *s)
-  {
+  static inline std::wstring to_wstring(const struct_type *s) {
     return std::wstring(s->str, s->length);
   }
-  static inline bool from_wstring(const std::wstring& str, struct_type *s)
-  {
+  static inline bool from_wstring(const std::wstring& str, struct_type *s) {
     return cef_string_wide_set(str.c_str(), str.length(), s, true) ?
         true : false;
   }
 #if defined(BUILDING_CEF_SHARED)
 #if defined(WCHAR_T_IS_UTF32)
-  static inline string16 to_string16(const struct_type *s)
-  {
+  static inline string16 to_string16(const struct_type *s) {
     cef_string_utf16_t cstr;
     memset(&cstr, 0, sizeof(cstr));
     cef_string_wide_to_utf16(s->str, s->length, &cstr);
@@ -98,23 +99,20 @@ struct CefStringTraitsWide {
     cef_string_utf16_clear(&cstr);
     return str;
   }
-  static inline bool from_string16(const string16& str, struct_type *s)
-  {
+  static inline bool from_string16(const string16& str, struct_type *s) {
     return cef_string_utf16_to_wide(str.c_str(), str.length(), s) ?
         true : false;
   }
-#else // WCHAR_T_IS_UTF32
-  static inline string16 to_string16(const struct_type *s)
-  {
+#else  // WCHAR_T_IS_UTF32
+  static inline string16 to_string16(const struct_type *s) {
     return string16(s->str, s->length);
   }
-  static inline bool from_string16(const string16& str, struct_type *s)
-  {
+  static inline bool from_string16(const string16& str, struct_type *s) {
     return cef_string_wide_set(str.c_str(), str.length(), s, true) ?
         true : false;
   }
-#endif // WCHAR_T_IS_UTF32
-#endif // BUILDING_CEF_SHARED
+#endif  // WCHAR_T_IS_UTF32
+#endif  // BUILDING_CEF_SHARED
 };
 
 ///
@@ -124,33 +122,33 @@ struct CefStringTraitsUTF8 {
   typedef char char_type;
   typedef cef_string_utf8_t struct_type;
   typedef cef_string_userfree_utf8_t userfree_struct_type;
-  
+
   static inline void clear(struct_type *s) { cef_string_utf8_clear(s); }
   static inline int set(const char_type* src, size_t src_size,
-                        struct_type *output, int copy)
-    { return cef_string_utf8_set(src, src_size, output, copy); }
-  static inline int compare(const struct_type* s1, const struct_type* s2)
-    { return cef_string_utf8_cmp(s1, s2); }
-  static inline userfree_struct_type userfree_alloc()
-    { return cef_string_userfree_utf8_alloc(); }
-  static inline void userfree_free(userfree_struct_type ufs)
-    { return cef_string_userfree_utf8_free(ufs); }
+                        struct_type* output, int copy) {
+    return cef_string_utf8_set(src, src_size, output, copy);
+  }
+  static inline int compare(const struct_type* s1, const struct_type* s2) {
+    return cef_string_utf8_cmp(s1, s2);
+  }
+  static inline userfree_struct_type userfree_alloc() {
+    return cef_string_userfree_utf8_alloc();
+  }
+  static inline void userfree_free(userfree_struct_type ufs) {
+    return cef_string_userfree_utf8_free(ufs);
+  }
 
   // Conversion methods.
-  static inline bool from_ascii(const char* str, size_t len, struct_type* s)
-  {
+  static inline bool from_ascii(const char* str, size_t len, struct_type* s) {
     return cef_string_utf8_copy(str, len, s) ? true : false;
   }
-  static inline std::string to_string(const struct_type* s)
-  {
+  static inline std::string to_string(const struct_type* s) {
     return std::string(s->str, s->length);
   }
-  static inline bool from_string(const std::string& str, struct_type* s)
-  {
+  static inline bool from_string(const std::string& str, struct_type* s) {
     return cef_string_utf8_copy(str.c_str(), str.length(), s) ? true : false;
   }
-  static inline std::wstring to_wstring(const struct_type* s)
-  {
+  static inline std::wstring to_wstring(const struct_type* s) {
     cef_string_wide_t cstr;
     memset(&cstr, 0, sizeof(cstr));
     cef_string_utf8_to_wide(s->str, s->length, &cstr);
@@ -160,13 +158,11 @@ struct CefStringTraitsUTF8 {
     cef_string_wide_clear(&cstr);
     return str;
   }
-  static inline bool from_wstring(const std::wstring& str, struct_type* s)
-  {
+  static inline bool from_wstring(const std::wstring& str, struct_type* s) {
     return cef_string_wide_to_utf8(str.c_str(), str.length(), s) ? true : false;
   }
 #if defined(BUILDING_CEF_SHARED)
-  static inline string16 to_string16(const struct_type* s)
-  {
+  static inline string16 to_string16(const struct_type* s) {
     cef_string_utf16_t cstr;
     memset(&cstr, 0, sizeof(cstr));
     cef_string_utf8_to_utf16(s->str, s->length, &cstr);
@@ -176,12 +172,11 @@ struct CefStringTraitsUTF8 {
     cef_string_utf16_clear(&cstr);
     return str;
   }
-  static inline bool from_string16(const string16& str, struct_type* s)
-  {
+  static inline bool from_string16(const string16& str, struct_type* s) {
     return cef_string_utf16_to_utf8(str.c_str(), str.length(), s) ?
         true : false;
   }
-#endif // BUILDING_CEF_SHARED
+#endif  // BUILDING_CEF_SHARED
 };
 
 ///
@@ -191,25 +186,27 @@ struct CefStringTraitsUTF16 {
   typedef char16 char_type;
   typedef cef_string_utf16_t struct_type;
   typedef cef_string_userfree_utf16_t userfree_struct_type;
-  
+
   static inline void clear(struct_type *s) { cef_string_utf16_clear(s); }
   static inline int set(const char_type* src, size_t src_size,
-                        struct_type *output, int copy)
-    { return cef_string_utf16_set(src, src_size, output, copy); }
-  static inline int compare(const struct_type* s1, const struct_type* s2)
-    { return cef_string_utf16_cmp(s1, s2); }
-  static inline userfree_struct_type userfree_alloc()
-    { return cef_string_userfree_utf16_alloc(); }
-  static inline void userfree_free(userfree_struct_type ufs)
-    { return cef_string_userfree_utf16_free(ufs); }
+                        struct_type* output, int copy) {
+    return cef_string_utf16_set(src, src_size, output, copy);
+  }
+  static inline int compare(const struct_type* s1, const struct_type* s2) {
+    return cef_string_utf16_cmp(s1, s2);
+  }
+  static inline userfree_struct_type userfree_alloc() {
+    return cef_string_userfree_utf16_alloc();
+  }
+  static inline void userfree_free(userfree_struct_type ufs) {
+    return cef_string_userfree_utf16_free(ufs);
+  }
 
   // Conversion methods.
-  static inline bool from_ascii(const char* str, size_t len, struct_type* s)
-  {
+  static inline bool from_ascii(const char* str, size_t len, struct_type* s) {
     return cef_string_ascii_to_utf16(str, len, s) ? true : false;
   }
-  static inline std::string to_string(const struct_type* s)
-  {
+  static inline std::string to_string(const struct_type* s) {
     cef_string_utf8_t cstr;
     memset(&cstr, 0, sizeof(cstr));
     cef_string_utf16_to_utf8(s->str, s->length, &cstr);
@@ -219,14 +216,12 @@ struct CefStringTraitsUTF16 {
     cef_string_utf8_clear(&cstr);
     return str;
   }
-  static inline bool from_string(const std::string& str, struct_type* s)
-  {
+  static inline bool from_string(const std::string& str, struct_type* s) {
     return cef_string_utf8_to_utf16(str.c_str(), str.length(), s) ?
         true : false;
   }
 #if defined(WCHAR_T_IS_UTF32)
-  static inline std::wstring to_wstring(const struct_type* s)
-  {
+  static inline std::wstring to_wstring(const struct_type* s) {
     cef_string_wide_t cstr;
     memset(&cstr, 0, sizeof(cstr));
     cef_string_utf16_to_wide(s->str, s->length, &cstr);
@@ -236,33 +231,28 @@ struct CefStringTraitsUTF16 {
     cef_string_wide_clear(&cstr);
     return str;
   }
-  static inline bool from_wstring(const std::wstring& str, struct_type* s)
-  {
+  static inline bool from_wstring(const std::wstring& str, struct_type* s) {
     return cef_string_wide_to_utf16(str.c_str(), str.length(), s) ?
         true : false;
   }
-#else // WCHAR_T_IS_UTF32
-  static inline std::wstring to_wstring(const struct_type* s)
-  {
+#else  // WCHAR_T_IS_UTF32
+  static inline std::wstring to_wstring(const struct_type* s) {
     return std::wstring(s->str, s->length);
   }
-  static inline bool from_wstring(const std::wstring& str, struct_type* s)
-  {
+  static inline bool from_wstring(const std::wstring& str, struct_type* s) {
     return cef_string_utf16_set(str.c_str(), str.length(), s, true) ?
         true : false;
   }
-#endif // WCHAR_T_IS_UTF32
+#endif  // WCHAR_T_IS_UTF32
 #if defined(BUILDING_CEF_SHARED)
-  static inline string16 to_string16(const struct_type* s)
-  {
+  static inline string16 to_string16(const struct_type* s) {
     return string16(s->str, s->length);
   }
-  static inline bool from_string16(const string16& str, struct_type* s)
-  {
+  static inline bool from_string16(const string16& str, struct_type* s) {
     return cef_string_utf16_set(str.c_str(), str.length(), s, true) ?
         true : false;
   }
-#endif // BUILDING_CEF_SHARED
+#endif  // BUILDING_CEF_SHARED
 };
 
 ///
@@ -295,7 +285,7 @@ struct CefStringTraitsUTF16 {
 ///
 template 
 class CefStringBase {
-public:
+ public:
   typedef typename traits::char_type char_type;
   typedef typename traits::struct_type struct_type;
   typedef typename traits::userfree_struct_type userfree_struct_type;
@@ -304,32 +294,42 @@ public:
   // Default constructor.
   ///
   CefStringBase() : string_(NULL), owner_(false) {}
-  
+
   ///
   // Create a new string from an existing string. Data will always be copied.
   ///
-  CefStringBase(const CefStringBase& str) : string_(NULL), owner_(false)
-    { FromString(str.c_str(), str.length(), true); }
-  
+  CefStringBase(const CefStringBase& str)
+    : string_(NULL), owner_(false) {
+    FromString(str.c_str(), str.length(), true);
+  }
+
   ///
   // Create a new string from an existing std::string. Data will be always
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  CefStringBase(const std::string& src) : string_(NULL), owner_(false)
-    { FromString(src); }
-  CefStringBase(const char* src) : string_(NULL), owner_(false)
-    { FromString(std::string(src)); }
-  
+  CefStringBase(const std::string& src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
+    FromString(src);
+  }
+  CefStringBase(const char* src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
+    FromString(std::string(src));
+  }
+
   ///
   // Create a new string from an existing std::wstring. Data will be always
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  CefStringBase(const std::wstring& src) : string_(NULL), owner_(false)
-    { FromWString(src); }
- CefStringBase(const wchar_t* src) : string_(NULL), owner_(false)
-    { FromWString(std::wstring(src)); }
+  CefStringBase(const std::wstring& src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
+    FromWString(src);
+  }
+  CefStringBase(const wchar_t* src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
+    FromWString(std::wstring(src));
+  }
 
 #if (defined(BUILDING_CEF_SHARED) && defined(WCHAR_T_IS_UTF32))
   ///
@@ -337,12 +337,16 @@ public:
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  CefStringBase(const string16& src) : string_(NULL), owner_(false)
-    { FromString16(src); }
-  CefStringBase(const char16* src) : string_(NULL), owner_(false)
-    { FromString16(string16(src)); }
-#endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
-  
+  CefStringBase(const string16& src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
+    FromString16(src);
+  }
+  CefStringBase(const char16* src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
+    FromString16(string16(src));
+  }
+#endif  // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
+
   ///
   // Create a new string from an existing character array. If |copy| is true
   // this class will copy the data. Otherwise, this class will reference the
@@ -350,16 +354,17 @@ public:
   // and will not be freed by this class.
   ///
   CefStringBase(const char_type* src, size_t src_len, bool copy)
-    : string_(NULL), owner_(false)
-    { FromString(src, src_len, copy); }
-  
+    : string_(NULL), owner_(false) {
+    FromString(src, src_len, copy);
+  }
+
   ///
   // Create a new string referencing an existing string structure without taking
   // ownership. Referenced structures must exist for the lifetime of this class
   // and will not be freed by this class.
   ///
-  CefStringBase(const struct_type* src) : string_(NULL), owner_(false)
-  {
+  CefStringBase(const struct_type* src)  // NOLINT(runtime/explicit)
+    : string_(NULL), owner_(false) {
     if (!src)
       return;
     // Reference the existing structure without taking ownership.
@@ -376,17 +381,17 @@ public:
   // Return a read-only pointer to the string data.
   ///
   const char_type* c_str() const { return (string_ ? string_->str : NULL); }
-  
+
   ///
   // Return the length of the string data.
   ///
   size_t length() const { return (string_ ? string_->length : 0); }
-  
+
   ///
   // Return the length of the string data.
   ///
   inline size_t size() const { return length(); }
-  
+
   ///
   // Returns true if the string is empty.
   ///
@@ -395,8 +400,7 @@ public:
   ///
   // Compare this string to the specified string.
   ///
-  int compare(const CefStringBase& str) const
-  {
+  int compare(const CefStringBase& str) const {
     if (empty() && str.empty())
       return 0;
     if (empty())
@@ -405,12 +409,11 @@ public:
       return 1;
     return traits::compare(string_, str.GetStruct());
   }
-  
+
   ///
   // Clear the string data.
   ///
-  void clear()
-  {
+  void clear() {
     if (!empty())
       traits::clear(string_);
   }
@@ -422,29 +425,27 @@ public:
   // Returns true if this class owns the underlying string structure.
   ///
   bool IsOwner() const { return owner_; }
-  
+
   ///
   // Returns a read-only pointer to the underlying string structure. May return
   // NULL if no structure is currently allocated.
   ///
   const struct_type* GetStruct() const { return string_; }
-  
+
   ///
   // Returns a writable pointer to the underlying string structure. Will never
   // return NULL.
   ///
-  struct_type* GetWritableStruct()
-  {
+  struct_type* GetWritableStruct() {
     AllocIfNeeded();
     return string_;
   }
-  
+
   ///
   // Clear the state of this class. The underlying string structure and data
   // will be freed if this class owns the structure.
   ///
-  void ClearAndFree()
-  {
+  void ClearAndFree() {
     if (!string_)
       return;
     if (owner_) {
@@ -459,11 +460,10 @@ public:
   // Attach to the specified string structure. If |owner| is true this class
   // will take ownership of the structure.
   ///
-  void Attach(struct_type* str, bool owner)
-  {
+  void Attach(struct_type* str, bool owner) {
     // Free the previous structure and data, if any.
     ClearAndFree();
-    
+
     string_ = str;
     owner_ = owner;
   }
@@ -473,8 +473,7 @@ public:
   // userfree structure itself will be freed. Only use this method with userfree
   // structures.
   ///
-  void AttachToUserFree(userfree_struct_type str)
-  {
+  void AttachToUserFree(userfree_struct_type str) {
     // Free the previous structure and data, if any.
     ClearAndFree();
 
@@ -484,7 +483,7 @@ public:
     AllocIfNeeded();
     owner_ = true;
     memcpy(string_, str, sizeof(struct_type));
-    
+
     // Free the |str| structure but not the data.
     memset(str, 0, sizeof(struct_type));
     traits::userfree_free(str);
@@ -495,8 +494,7 @@ public:
   // this method if you already hold a pointer to the underlying string
   // structure.
   ///
-  void Detach()
-  {
+  void Detach() {
     string_ = NULL;
     owner_ = false;
   }
@@ -506,14 +504,13 @@ public:
   // data. This class will be disassociated from the data. May return NULL if
   // this string class currently contains no data.
   ///
-  userfree_struct_type DetachToUserFree()
-  {
+  userfree_struct_type DetachToUserFree() {
     if (empty())
       return NULL;
-    
+
     userfree_struct_type str = traits::userfree_alloc();
     memcpy(str, string_, sizeof(struct_type));
-    
+
     // Free this class' structure but not the data.
     memset(string_, 0, sizeof(struct_type));
     ClearAndFree();
@@ -527,8 +524,7 @@ public:
   // existing data. Referenced data must exist for the lifetime of this class
   // and will not be freed by this class.
   ///
-  bool FromString(const char_type* src, size_t src_len, bool copy)
-  {
+  bool FromString(const char_type* src, size_t src_len, bool copy) {
     if (src == NULL || src_len == 0) {
       clear();
       return true;
@@ -536,14 +532,13 @@ public:
     AllocIfNeeded();
     return traits::set(src, src_len, string_, copy) ? true : false;
   }
-  
+
   ///
   // Set this string's data from an existing ASCII string. Data will be always
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  bool FromASCII(const char* str)
-  {
+  bool FromASCII(const char* str) {
     size_t len = str ? strlen(str) : 0;
     if (len == 0) {
       clear();
@@ -552,25 +547,23 @@ public:
     AllocIfNeeded();
     return traits::from_ascii(str, len, string_);
   }
-  
+
   ///
   // Return this string's data as a std::string. Translation will occur if
   // necessary based on the underlying string type.
   ///
-  std::string ToString() const
-  {
+  std::string ToString() const {
     if (empty())
       return std::string();
     return traits::to_string(string_);
   }
-  
+
   ///
   // Set this string's data from an existing std::string. Data will be always
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  bool FromString(const std::string& str)
-  {
+  bool FromString(const std::string& str) {
     if (str.empty()) {
       clear();
       return true;
@@ -578,25 +571,23 @@ public:
     AllocIfNeeded();
     return traits::from_string(str, string_);
   }
-  
+
   ///
   // Return this string's data as a std::wstring. Translation will occur if
   // necessary based on the underlying string type.
   ///
-  std::wstring ToWString() const
-  {
+  std::wstring ToWString() const {
     if (empty())
       return std::wstring();
     return traits::to_wstring(string_);
   }
-  
+
   ///
   // Set this string's data from an existing std::wstring. Data will be always
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  bool FromWString(const std::wstring& str)
-  {
+  bool FromWString(const std::wstring& str) {
     if (str.empty()) {
       clear();
       return true;
@@ -609,20 +600,18 @@ public:
   // Return this string's data as a string16. Translation will occur if
   // necessary based on the underlying string type.
   ///
-  string16 ToString16() const
-  {
+  string16 ToString16() const {
     if (empty())
       return string16();
     return traits::to_string16(string_);
   }
-  
+
   ///
   // Set this string's data from an existing string16. Data will be always
   // copied. Translation will occur if necessary based on the underlying string
   // type.
   ///
-  bool FromString16(const string16& str)
-  {
+  bool FromString16(const string16& str) {
     if (str.empty()) {
       clear();
       return true;
@@ -630,51 +619,76 @@ public:
     AllocIfNeeded();
     return traits::from_string16(str, string_);
   }
-#endif // BUILDING_CEF_SHARED
+#endif  // BUILDING_CEF_SHARED
 
   ///
   // Comparison operator overloads.
   ///
-  bool operator<(const CefStringBase& str) const
-    { return (compare(str) < 0); }
-  bool operator<=(const CefStringBase& str) const
-    { return (compare(str) <= 0); }
-  bool operator>(const CefStringBase& str) const
-    { return (compare(str) > 0); }
-  bool operator>=(const CefStringBase& str) const
-    { return (compare(str) >= 0); }
-  bool operator==(const CefStringBase& str) const
-    { return (compare(str) == 0); }
-  bool operator!=(const CefStringBase& str) const
-    { return (compare(str) != 0); }
-  
+  bool operator<(const CefStringBase& str) const {
+    return (compare(str) < 0);
+  }
+  bool operator<=(const CefStringBase& str) const {
+    return (compare(str) <= 0);
+  }
+  bool operator>(const CefStringBase& str) const {
+    return (compare(str) > 0);
+  }
+  bool operator>=(const CefStringBase& str) const {
+    return (compare(str) >= 0);
+  }
+  bool operator==(const CefStringBase& str) const {
+    return (compare(str) == 0);
+  }
+  bool operator!=(const CefStringBase& str) const {
+    return (compare(str) != 0);
+  }
+
   ///
   // Assignment operator overloads.
   ///
-  CefStringBase& operator=(const CefStringBase& str)
-    { FromString(str.c_str(), str.length(), true); return *this; }
-  operator std::string() const { return ToString(); }
-  CefStringBase& operator=(const std::string& str)
-    { FromString(str); return *this; }
-  CefStringBase& operator=(const char* str)
-    { FromString(std::string(str)); return *this; }
-  operator std::wstring() const { return ToWString(); }
-  CefStringBase& operator=(const std::wstring& str)
-    { FromWString(str); return *this; }
-  CefStringBase& operator=(const wchar_t* str)
-    { FromWString(std::wstring(str)); return *this; }
+  CefStringBase& operator=(const CefStringBase& str) {
+    FromString(str.c_str(), str.length(), true);
+    return *this;
+  }
+  operator std::string() const {
+    return ToString();
+  }
+  CefStringBase& operator=(const std::string& str) {
+    FromString(str);
+    return *this;
+  }
+  CefStringBase& operator=(const char* str) {
+    FromString(std::string(str));
+    return *this;
+  }
+  operator std::wstring() const {
+    return ToWString();
+  }
+  CefStringBase& operator=(const std::wstring& str) {
+    FromWString(str);
+    return *this;
+  }
+  CefStringBase& operator=(const wchar_t* str) {
+    FromWString(std::wstring(str));
+    return *this;
+  }
 #if (defined(BUILDING_CEF_SHARED) && defined(WCHAR_T_IS_UTF32))
-  operator string16() const { return ToString16(); }
-  CefStringBase& operator=(const string16& str)
-    { FromString16(str); return *this; }
-  CefStringBase& operator=(const char16* str)
-    { FromString16(string16(str)); return *this; }
-#endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
+  operator string16() const {
+    return ToString16();
+  }
+  CefStringBase& operator=(const string16& str) {
+    FromString16(str);
+    return *this;
+  }
+  CefStringBase& operator=(const char16* str) {
+    FromString16(string16(str));
+    return *this;
+  }
+#endif  // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32
 
-private:
+ private:
   // Allocate the string structure if it doesn't already exist.
-  void AllocIfNeeded()
-  {
+  void AllocIfNeeded() {
     if (string_ == NULL) {
       string_ = new struct_type;
       memset(string_, 0, sizeof(struct_type));
@@ -691,4 +705,4 @@ typedef CefStringBase CefStringWide;
 typedef CefStringBase CefStringUTF8;
 typedef CefStringBase CefStringUTF16;
 
-#endif // _CEF_STRING_WRAPPERS_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_
diff --git a/include/internal/cef_time.h b/include/internal/cef_time.h
index b26fa9b24..5d38cf7bc 100644
--- a/include/internal/cef_time.h
+++ b/include/internal/cef_time.h
@@ -27,21 +27,21 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_TIME_H
-#define _CEF_TIME_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TIME_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TIME_H_
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include "cef_export.h"
+#include "include/internal/cef_export.h"
 #include 
 
 ///
 // Time information. Values should always be in UTC.
 ///
-typedef struct _cef_time_t
-{
+typedef struct _cef_time_t {
   int year;          // Four digit year "2007"
   int month;         // 1-based month (values 1 = January, etc.)
 #if !defined(OS_MACOSX)
@@ -75,4 +75,4 @@ CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time);
 }
 #endif
 
-#endif // _CEF_TIME_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TIME_H_
diff --git a/include/internal/cef_tuple.h b/include/internal/cef_tuple.h
index da71441de..d9a1a2c96 100644
--- a/include/internal/cef_tuple.h
+++ b/include/internal/cef_tuple.h
@@ -53,8 +53,8 @@
 //   DispatchToMethod(&foo, &Foo::SomeMeth, MakeTuple(1, 2, 3));
 //   // foo->SomeMeth(1, 2, 3);
 
-#ifndef BASE_TUPLE_H__
-#define BASE_TUPLE_H__
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TUPLE_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TUPLE_H_
 #pragma once
 
 #if defined(OS_CHROMEOS)
@@ -144,7 +144,7 @@ struct Tuple3 {
   Tuple3(typename TupleTraits::ParamType a,
          typename TupleTraits::ParamType b,
          typename TupleTraits::ParamType c)
-      : a(a), b(b), c(c){
+      : a(a), b(b), c(c) {
   }
 
   A a;
@@ -575,7 +575,6 @@ inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) {
 
 template 
 inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1& arg) {
-
 #if defined(OS_CHROMEOS)
   // To troubleshoot crosbug.com/7327.
   CHECK(obj);
@@ -1080,4 +1079,4 @@ inline void DispatchToMethod(ObjT* obj, Method method,
                  &out->a, &out->b, &out->c, &out->d, &out->e);
 }
 
-#endif  // BASE_TUPLE_H__
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TUPLE_H_
diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h
index 78d01c61a..d9dd231c0 100644
--- a/include/internal/cef_types.h
+++ b/include/internal/cef_types.h
@@ -28,31 +28,37 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_TYPES_H
-#define _CEF_TYPES_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
+#pragma once
 
-#include "cef_build.h"
-#include "cef_string.h"
-#include "cef_string_list.h"
-#include "cef_time.h"
+#include "include/internal/cef_build.h"
+#include "include/internal/cef_string.h"
+#include "include/internal/cef_string_list.h"
+#include "include/internal/cef_time.h"
 
 // Bring in platform-specific definitions.
 #if defined(OS_WIN)
-#include "cef_types_win.h"
+#include "include/internal/cef_types_win.h"
 #elif defined(OS_MACOSX)
-#include "cef_types_mac.h"
+#include "include/internal/cef_types_mac.h"
 #elif defined(OS_LINUX)
-#include "cef_types_linux.h"
+#include "include/internal/cef_types_linux.h"
 #endif
 
-// The NSPR system headers define 64-bit as |long| when possible.  In order to
-// not have typedef mismatches, we do the same on LP64.
-#if __LP64__
-typedef long                int64;
-typedef unsigned long       uint64;
+#include          // For size_t
+
+// The NSPR system headers define 64-bit as |long| when possible, except on
+// Mac OS X.  In order to not have typedef mismatches, we do the same on LP64.
+//
+// On Mac OS X, |long long| is used for 64-bit types for compatibility with
+//  format macros even in the LP64 model.
+#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
+typedef long                int64;  // NOLINT(runtime/int)
+typedef unsigned long       uint64;  // NOLINT(runtime/int)
 #else
-typedef long long           int64;
-typedef unsigned long long  uint64;
+typedef long long           int64;  // NOLINT(runtime/int)
+typedef unsigned long long  uint64;  // NOLINT(runtime/int)
 #endif
 
 #ifdef __cplusplus
@@ -62,8 +68,7 @@ extern "C" {
 ///
 // Log severity levels.
 ///
-enum cef_log_severity_t
-{
+enum cef_log_severity_t {
   LOGSEVERITY_VERBOSE = -1,
   LOGSEVERITY_INFO,
   LOGSEVERITY_WARNING,
@@ -77,8 +82,7 @@ enum cef_log_severity_t
 // Initialization settings. Specify NULL or 0 to get the recommended default
 // values.
 ///
-typedef struct _cef_settings_t
-{
+typedef struct _cef_settings_t {
   ///
   // Size of this structure.
   ///
@@ -90,14 +94,14 @@ typedef struct _cef_settings_t
   // your application message loop.
   ///
   bool multi_threaded_message_loop;
-  
+
   ///
   // The location where cache data will be stored on disk. If empty an
   // in-memory cache will be used. HTML5 databases such as localStorage will
   // only persist across sessions if a cache path is specified.
   ///
   cef_string_t cache_path;
-  
+
   ///
   // Value that will be returned as the User-Agent HTTP header. If empty the
   // default User-Agent string will be used.
@@ -160,7 +164,7 @@ typedef struct _cef_settings_t
 
 #if defined(OS_WIN)
   ///
-  // Set to true (1) to use the system proxy resolver on Windows when 
+  // Set to true (1) to use the system proxy resolver on Windows when
   // "Automatically detect settings" is checked. This setting is disabled
   // by default for performance reasons.
   ///
@@ -173,8 +177,7 @@ typedef struct _cef_settings_t
 // default values. The consequences of using custom values may not be well
 // tested.
 ///
-typedef struct _cef_browser_settings_t
-{
+typedef struct _cef_browser_settings_t {
   ///
   // Size of this structure.
   ///
@@ -328,7 +331,7 @@ typedef struct _cef_browser_settings_t
   // Set to true (1) to enable the user style sheet for all pages.
   ///
   bool user_style_sheet_enabled;
-  
+
   ///
   // Location of the user style sheet. This must be a data URL of the form
   // "data:text/css;charset=utf-8;base64,csscontent" where "csscontent" is the
@@ -419,8 +422,7 @@ typedef struct _cef_browser_settings_t
 ///
 // URL component parts.
 ///
-typedef struct _cef_urlparts_t
-{
+typedef struct _cef_urlparts_t {
   ///
   // The complete URL specification.
   ///
@@ -466,8 +468,7 @@ typedef struct _cef_urlparts_t
 ///
 // Cookie information.
 ///
-typedef struct _cef_cookie_t
-{
+typedef struct _cef_cookie_t {
   ///
   // The cookie name.
   ///
@@ -506,7 +507,7 @@ typedef struct _cef_cookie_t
   // cookie creation.
   ///
   cef_time_t creation;
-  
+
   ///
   // The cookie last access date. This is automatically populated by the system
   // on access.
@@ -523,8 +524,7 @@ typedef struct _cef_cookie_t
 ///
 // Storage types.
 ///
-enum cef_storage_type_t
-{
+enum cef_storage_type_t {
   ST_LOCALSTORAGE = 0,
   ST_SESSIONSTORAGE,
 };
@@ -532,8 +532,7 @@ enum cef_storage_type_t
 ///
 // Mouse button types.
 ///
-enum cef_mouse_button_type_t
-{
+enum cef_mouse_button_type_t {
   MBT_LEFT   = 0,
   MBT_MIDDLE,
   MBT_RIGHT,
@@ -542,8 +541,7 @@ enum cef_mouse_button_type_t
 ///
 // Key types.
 ///
-enum cef_key_type_t
-{
+enum cef_key_type_t {
   KT_KEYUP    = 0,
   KT_KEYDOWN,
   KT_CHAR,
@@ -552,8 +550,7 @@ enum cef_key_type_t
 ///
 // Various browser navigation types supported by chrome.
 ///
-enum cef_handler_navtype_t
-{
+enum cef_handler_navtype_t {
   NAVTYPE_LINKCLICKED = 0,
   NAVTYPE_FORMSUBMITTED,
   NAVTYPE_BACKFORWARD,
@@ -567,8 +564,7 @@ enum cef_handler_navtype_t
 // Supported error code values. See net\base\net_error_list.h for complete
 // descriptions of the error codes.
 ///
-enum cef_handler_errorcode_t
-{
+enum cef_handler_errorcode_t {
   ERR_FAILED = -2,
   ERR_ABORTED = -3,
   ERR_INVALID_ARGUMENT = -4,
@@ -624,8 +620,7 @@ enum cef_handler_errorcode_t
 // destination. These constants match their equivalents in WebCore's
 // DragActions.h and should not be renumbered.
 ///
-enum cef_drag_operations_mask_t
-{
+enum cef_drag_operations_mask_t {
     DRAG_OPERATION_NONE    = 0,
     DRAG_OPERATION_COPY    = 1,
     DRAG_OPERATION_LINK    = 2,
@@ -639,8 +634,7 @@ enum cef_drag_operations_mask_t
 ///
 // V8 access control values.
 ///
-enum cef_v8_accesscontrol_t
-{
+enum cef_v8_accesscontrol_t {
   V8_ACCESS_CONTROL_DEFAULT               = 0,
   V8_ACCESS_CONTROL_ALL_CAN_READ          = 1,
   V8_ACCESS_CONTROL_ALL_CAN_WRITE         = 1 << 1,
@@ -650,9 +644,8 @@ enum cef_v8_accesscontrol_t
 ///
 // V8 property attribute values.
 ///
-enum cef_v8_propertyattribute_t
-{
-  V8_PROPERTY_ATTRIBUTE_NONE       = 0,       // Writeable, Enumerable, 
+enum cef_v8_propertyattribute_t {
+  V8_PROPERTY_ATTRIBUTE_NONE       = 0,       // Writeable, Enumerable,
                                               //   Configurable
   V8_PROPERTY_ATTRIBUTE_READONLY   = 1 << 0,  // Not writeable
   V8_PROPERTY_ATTRIBUTE_DONTENUM   = 1 << 1,  // Not enumerable
@@ -662,8 +655,7 @@ enum cef_v8_propertyattribute_t
 ///
 // Structure representing menu information.
 ///
-typedef struct _cef_menu_info_t
-{
+typedef struct _cef_menu_info_t {
   ///
   // Values from the cef_handler_menutypebits_t enumeration.
   ///
@@ -695,8 +687,7 @@ typedef struct _cef_menu_info_t
 // The cef_menu_info_t typeFlags value will be a combination of the
 // following values.
 ///
-enum cef_menu_typebits_t
-{
+enum cef_menu_typebits_t {
   ///
   // No node is selected
   ///
@@ -743,8 +734,7 @@ enum cef_menu_typebits_t
 // The cef_menu_info_t editFlags value will be a combination of the
 // following values.
 ///
-enum cef_menu_capabilitybits_t
-{
+enum cef_menu_capabilitybits_t {
   // Values from WebContextMenuData::EditFlags in WebContextMenuData.h
   MENU_CAN_DO_NONE = 0x0,
   MENU_CAN_UNDO = 0x1,
@@ -763,8 +753,7 @@ enum cef_menu_capabilitybits_t
 ///
 // Supported menu ID values.
 ///
-enum cef_menu_id_t
-{
+enum cef_menu_id_t {
   MENU_ID_NAV_BACK = 10,
   MENU_ID_NAV_FORWARD = 11,
   MENU_ID_NAV_RELOAD = 12,
@@ -781,8 +770,7 @@ enum cef_menu_id_t
   MENU_ID_VIEWSOURCE = 31,
 };
 
-enum cef_paint_element_type_t
-{
+enum cef_paint_element_type_t {
   PET_VIEW  = 0,
   PET_POPUP,
 };
@@ -790,15 +778,13 @@ enum cef_paint_element_type_t
 ///
 // Post data elements may represent either bytes or files.
 ///
-enum cef_postdataelement_type_t
-{
+enum cef_postdataelement_type_t {
   PDE_TYPE_EMPTY  = 0,
   PDE_TYPE_BYTES,
   PDE_TYPE_FILE,
 };
 
-enum cef_weburlrequest_flags_t
-{
+enum cef_weburlrequest_flags_t {
   WUR_FLAG_NONE = 0,
   WUR_FLAG_SKIP_CACHE = 0x1,
   WUR_FLAG_ALLOW_CACHED_CREDENTIALS = 0x2,
@@ -808,8 +794,7 @@ enum cef_weburlrequest_flags_t
   WUR_FLAG_REPORT_RAW_HEADERS = 0x20
 };
 
-enum cef_weburlrequest_state_t
-{
+enum cef_weburlrequest_state_t {
   WUR_STATE_UNSENT = 0,
   WUR_STATE_STARTED = 1,
   WUR_STATE_HEADERS_RECEIVED = 2,
@@ -822,8 +807,7 @@ enum cef_weburlrequest_state_t
 ///
 // Focus sources.
 ///
-enum cef_handler_focus_source_t
-{
+enum cef_handler_focus_source_t {
   ///
   // The source is explicit navigation via the API (LoadURL(), etc).
   ///
@@ -841,8 +825,7 @@ enum cef_handler_focus_source_t
 ///
 // Key event types.
 ///
-enum cef_handler_keyevent_type_t
-{
+enum cef_handler_keyevent_type_t {
   KEYEVENT_RAWKEYDOWN = 0,
   KEYEVENT_KEYDOWN,
   KEYEVENT_KEYUP,
@@ -852,8 +835,7 @@ enum cef_handler_keyevent_type_t
 ///
 // Key event modifiers.
 ///
-enum cef_handler_keyevent_modifiers_t
-{
+enum cef_handler_keyevent_modifiers_t {
   KEY_SHIFT = 1 << 0,
   KEY_CTRL  = 1 << 1,
   KEY_ALT   = 1 << 2,
@@ -863,8 +845,7 @@ enum cef_handler_keyevent_modifiers_t
 ///
 // Structure representing a rectangle.
 ///
-typedef struct _cef_rect_t
-{
+typedef struct _cef_rect_t {
   int x;
   int y;
   int width;
@@ -874,8 +855,7 @@ typedef struct _cef_rect_t
 ///
 // Existing thread IDs.
 ///
-enum cef_thread_id_t
-{
+enum cef_thread_id_t {
   TID_UI      = 0,
   TID_IO      = 1,
   TID_FILE    = 2,
@@ -884,8 +864,7 @@ enum cef_thread_id_t
 ///
 // Paper type for printing.
 ///
-enum cef_paper_type_t
-{
+enum cef_paper_type_t {
   PT_LETTER = 0,
   PT_LEGAL,
   PT_EXECUTIVE,
@@ -897,11 +876,10 @@ enum cef_paper_type_t
 ///
 // Paper metric information for printing.
 ///
-struct cef_paper_metrics
-{
+struct cef_paper_metrics {
   enum cef_paper_type_t paper_type;
-  //Length and width needed if paper_type is custom_size
-  //Units are in inches.
+  // Length and width needed if paper_type is custom_size
+  // Units are in inches.
   double length;
   double width;
 };
@@ -909,14 +887,13 @@ struct cef_paper_metrics
 ///
 // Paper print margins.
 ///
-struct cef_print_margins
-{
-  //Margin size in inches for left/right/top/bottom (this is content margins).
+struct cef_print_margins {
+  // Margin size in inches for left/right/top/bottom (this is content margins).
   double left;
   double right;
   double top;
   double bottom;
-  //Margin size (top/bottom) in inches for header/footer.
+  // Margin size (top/bottom) in inches for header/footer.
   double header;
   double footer;
 };
@@ -924,8 +901,7 @@ struct cef_print_margins
 ///
 // Page orientation for printing.
 ///
-enum cef_page_orientation
-{
+enum cef_page_orientation {
   PORTRAIT = 0,
   LANDSCAPE
 };
@@ -933,8 +909,7 @@ enum cef_page_orientation
 ///
 // Printing options.
 ///
-typedef struct _cef_print_options_t
-{
+typedef struct _cef_print_options_t {
   enum cef_page_orientation page_orientation;
   struct cef_paper_metrics paper_metrics;
   struct cef_print_margins paper_margins;
@@ -946,8 +921,7 @@ typedef struct _cef_print_options_t
 // before being passed to the parser. If a BOM is detected and the correct
 // decoder is available then that decoder will be used automatically.
 ///
-enum cef_xml_encoding_type_t
-{
+enum cef_xml_encoding_type_t {
   XML_ENCODING_NONE = 0,
   XML_ENCODING_UTF8,
   XML_ENCODING_UTF16LE,
@@ -958,8 +932,7 @@ enum cef_xml_encoding_type_t
 ///
 // XML node types.
 ///
-enum cef_xml_node_type_t
-{
+enum cef_xml_node_type_t {
   XML_NODE_UNSUPPORTED = 0,
   XML_NODE_PROCESSING_INSTRUCTION,
   XML_NODE_DOCUMENT_TYPE,
@@ -976,8 +949,7 @@ enum cef_xml_node_type_t
 ///
 // Status message types.
 ///
-enum cef_handler_statustype_t
-{
+enum cef_handler_statustype_t {
   STATUSTYPE_TEXT = 0,
   STATUSTYPE_MOUSEOVER_URL,
   STATUSTYPE_KEYBOARD_FOCUS_URL,
@@ -986,8 +958,7 @@ enum cef_handler_statustype_t
 ///
 // Popup window features.
 ///
-typedef struct _cef_popup_features_t
-{
+typedef struct _cef_popup_features_t {
   int x;
   bool xSet;
   int y;
@@ -1012,8 +983,7 @@ typedef struct _cef_popup_features_t
 ///
 // DOM document types.
 ///
-enum cef_dom_document_type_t
-{
+enum cef_dom_document_type_t {
   DOM_DOCUMENT_TYPE_UNKNOWN = 0,
   DOM_DOCUMENT_TYPE_HTML,
   DOM_DOCUMENT_TYPE_XHTML,
@@ -1023,8 +993,7 @@ enum cef_dom_document_type_t
 ///
 // DOM event category flags.
 ///
-enum cef_dom_event_category_t
-{
+enum cef_dom_event_category_t {
   DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
   DOM_EVENT_CATEGORY_UI = 0x1,
   DOM_EVENT_CATEGORY_MOUSE = 0x2,
@@ -1050,8 +1019,7 @@ enum cef_dom_event_category_t
 ///
 // DOM event processing phases.
 ///
-enum cef_dom_event_phase_t
-{
+enum cef_dom_event_phase_t {
   DOM_EVENT_PHASE_UNKNOWN = 0,
   DOM_EVENT_PHASE_CAPTURING,
   DOM_EVENT_PHASE_AT_TARGET,
@@ -1061,8 +1029,7 @@ enum cef_dom_event_phase_t
 ///
 // DOM node types.
 ///
-enum cef_dom_node_type_t
-{
+enum cef_dom_node_type_t {
   DOM_NODE_TYPE_UNSUPPORTED = 0,
   DOM_NODE_TYPE_ELEMENT,
   DOM_NODE_TYPE_ATTRIBUTE,
@@ -1082,8 +1049,7 @@ enum cef_dom_node_type_t
 ///
 // Proxy types.
 ///
-enum cef_proxy_type_t
-{
+enum cef_proxy_type_t {
   PROXY_TYPE_DIRECT = 0,
   PROXY_TYPE_NAMED,
   PROXY_TYPE_PAC_STRING,
@@ -1092,8 +1058,7 @@ enum cef_proxy_type_t
 ///
 // Proxy information.
 ///
-typedef struct _cef_proxy_info_t
-{
+typedef struct _cef_proxy_info_t {
   enum cef_proxy_type_t proxyType;
   cef_string_t proxyList;
 } cef_proxy_info_t;
@@ -1102,4 +1067,4 @@ typedef struct _cef_proxy_info_t
 }
 #endif
 
-#endif // _CEF_TYPES_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
diff --git a/include/internal/cef_types_linux.h b/include/internal/cef_types_linux.h
index 42da97ace..81e997a62 100644
--- a/include/internal/cef_types_linux.h
+++ b/include/internal/cef_types_linux.h
@@ -28,12 +28,15 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_TYPES_LINUX_H
-#define _CEF_TYPES_LINUX_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_
+#pragma once
+
+#include "include/internal/cef_build.h"
 
 #if defined(OS_LINUX)
 #include 
-#include "cef_string.h"
+#include "include/internal/cef_string.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -46,8 +49,7 @@ extern "C" {
 ///
 // Supported graphics implementations.
 ///
-enum cef_graphics_implementation_t
-{
+enum cef_graphics_implementation_t {
   DESKTOP_IN_PROCESS = 0,
   DESKTOP_IN_PROCESS_COMMAND_BUFFER,
 };
@@ -55,11 +57,10 @@ enum cef_graphics_implementation_t
 ///
 // Class representing window information.
 ///
-typedef struct _cef_window_info_t
-{
+typedef struct _cef_window_info_t {
   // Pointer for the parent GtkBox widget.
   cef_window_handle_t m_ParentWidget;
-  
+
   // Pointer for the new browser widget.
   cef_window_handle_t m_Widget;
 } cef_window_info_t;
@@ -67,8 +68,7 @@ typedef struct _cef_window_info_t
 ///
 // Class representing print context information.
 ///
-typedef struct _cef_print_info_t
-{
+typedef struct _cef_print_info_t {
   double m_Scale;
 } cef_print_info_t;
 
@@ -76,6 +76,6 @@ typedef struct _cef_print_info_t
 }
 #endif
 
-#endif // OS_LINUX
+#endif  // OS_LINUX
 
-#endif // _CEF_TYPES_LINUX_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_
diff --git a/include/internal/cef_types_mac.h b/include/internal/cef_types_mac.h
index 0773a9772..b04d23c78 100644
--- a/include/internal/cef_types_mac.h
+++ b/include/internal/cef_types_mac.h
@@ -28,11 +28,14 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_TYPES_MAC_H
-#define _CEF_TYPES_MAC_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
+#pragma once
+
+#include "include/internal/cef_build.h"
 
 #if defined(OS_MACOSX)
-#include "cef_string.h"
+#include "include/internal/cef_string.h"
 
 // Window handle.
 #ifdef __cplusplus
@@ -54,8 +57,7 @@ extern "C" {
 ///
 // Supported graphics implementations.
 ///
-enum cef_graphics_implementation_t
-{
+enum cef_graphics_implementation_t {
   DESKTOP_IN_PROCESS = 0,
   DESKTOP_IN_PROCESS_COMMAND_BUFFER,
 };
@@ -63,8 +65,7 @@ enum cef_graphics_implementation_t
 ///
 // Class representing window information.
 ///
-typedef struct _cef_window_info_t
-{
+typedef struct _cef_window_info_t {
   cef_string_t m_windowName;
   int m_x;
   int m_y;
@@ -74,7 +75,7 @@ typedef struct _cef_window_info_t
 
   // NSView pointer for the parent view.
   cef_window_handle_t m_ParentView;
-  
+
   // NSView pointer for the new browser view.
   cef_window_handle_t m_View;
 } cef_window_info_t;
@@ -82,8 +83,7 @@ typedef struct _cef_window_info_t
 ///
 // Class representing print context information.
 ///
-typedef struct _cef_print_info_t
-{
+typedef struct _cef_print_info_t {
   double m_Scale;
 } cef_print_info_t;
 
@@ -91,6 +91,6 @@ typedef struct _cef_print_info_t
 }
 #endif
 
-#endif // OS_MACOSX
+#endif  // OS_MACOSX
 
-#endif // _CEF_TYPES_MAC_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_
diff --git a/include/internal/cef_types_win.h b/include/internal/cef_types_win.h
index 7ce143bd2..c275f69d8 100644
--- a/include/internal/cef_types_win.h
+++ b/include/internal/cef_types_win.h
@@ -28,12 +28,15 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_TYPES_WIN_H
-#define _CEF_TYPES_WIN_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_
+#pragma once
+
+#include "include/internal/cef_build.h"
 
 #if defined(OS_WIN)
 #include 
-#include "cef_string.h"
+#include "include/internal/cef_string.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -46,8 +49,7 @@ extern "C" {
 ///
 // Supported graphics implementations.
 ///
-enum cef_graphics_implementation_t
-{
+enum cef_graphics_implementation_t {
   ANGLE_IN_PROCESS = 0,
   ANGLE_IN_PROCESS_COMMAND_BUFFER,
   DESKTOP_IN_PROCESS,
@@ -57,8 +59,7 @@ enum cef_graphics_implementation_t
 ///
 // Class representing window information.
 ///
-typedef struct _cef_window_info_t
-{
+typedef struct _cef_window_info_t {
   // Standard parameters required by CreateWindowEx()
   DWORD m_dwExStyle;
   cef_string_t m_windowName;
@@ -77,7 +78,7 @@ typedef struct _cef_window_info_t
 
   // Set to true to enable transparent painting.
   BOOL m_bTransparentPainting;
-  
+
   // Handle for the new browser window.
   cef_window_handle_t m_hWnd;
 } cef_window_info_t;
@@ -85,8 +86,7 @@ typedef struct _cef_window_info_t
 ///
 // Class representing print context information.
 ///
-typedef struct _cef_print_info_t
-{
+typedef struct _cef_print_info_t {
   HDC m_hDC;
   RECT m_Rect;
   double m_Scale;
@@ -96,6 +96,6 @@ typedef struct _cef_print_info_t
 }
 #endif
 
-#endif // OS_WIN
+#endif  // OS_WIN
 
-#endif // _CEF_TYPES_WIN_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_
diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h
index 239217597..770b70c32 100644
--- a/include/internal/cef_types_wrappers.h
+++ b/include/internal/cef_types_wrappers.h
@@ -27,40 +27,37 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef _CEF_TYPES_WRAPPERS_H
-#define _CEF_TYPES_WRAPPERS_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
+#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
+#pragma once
 
-#include "cef_string.h"
-#include "cef_string_list.h"
-#include "cef_types.h"
+#include "include/internal/cef_string.h"
+#include "include/internal/cef_string_list.h"
+#include "include/internal/cef_types.h"
 
 ///
 // Template class that provides common functionality for CEF structure wrapping.
 ///
 template 
 class CefStructBase : public traits::struct_type {
-public:
+ public:
   typedef typename traits::struct_type struct_type;
 
-  CefStructBase() : attached_to_(NULL)
-  {
+  CefStructBase() : attached_to_(NULL) {
     Init();
   }
-  virtual ~CefStructBase()
-  {
+  virtual ~CefStructBase() {
     // Only clear this object's data if it isn't currently attached to a
     // structure.
     if (!attached_to_)
-      Clear(this); 
+      Clear(this);
   }
 
-  CefStructBase(const CefStructBase& r)
-  {
+  CefStructBase(const CefStructBase& r) {
     Init();
     *this = r;
   }
-  CefStructBase(const struct_type& r)
-  {
+  CefStructBase(const struct_type& r) {  // NOLINT(runtime/explicit)
     Init();
     *this = r;
   }
@@ -68,8 +65,7 @@ public:
   ///
   // Clear this object's values.
   ///
-  void Reset()
-  {
+  void Reset() {
     Clear(this);
     Init();
   }
@@ -78,16 +74,15 @@ public:
   // Attach to the source structure's existing values. DetachTo() can be called
   // to insert the values back into the existing structure.
   ///
-  void AttachTo(struct_type& source)
-  {
+  void AttachTo(struct_type& source) {
     // Only clear this object's data if it isn't currently attached to a
     // structure.
     if (!attached_to_)
       Clear(this);
-    
+
     // This object is now attached to the new structure.
     attached_to_ = &source;
-    
+
     // Transfer ownership of the values from the source structure.
     memcpy(static_cast(this), &source, sizeof(struct_type));
   }
@@ -95,8 +90,7 @@ public:
   ///
   // Relinquish ownership of values to the target structure.
   ///
-  void DetachTo(struct_type& target)
-  {
+  void DetachTo(struct_type& target) {
     if (attached_to_ != &target) {
       // Clear the target structure's values only if we are not currently
       // attached to that structure.
@@ -114,25 +108,21 @@ public:
   // Set this object's values. If |copy| is true the source structure's values
   // will be copied instead of referenced.
   ///
-  void Set(const struct_type& source, bool copy)
-  {
+  void Set(const struct_type& source, bool copy) {
     traits::set(&source, this, copy);
   }
 
-  CefStructBase& operator=(const CefStructBase& s)
-  {
+  CefStructBase& operator=(const CefStructBase& s) {
     return operator=(static_cast(s));
   }
 
-  CefStructBase& operator=(const struct_type& s)
-  {
+  CefStructBase& operator=(const struct_type& s) {
     Set(s, true);
     return *this;
   }
 
-protected:
-  void Init()
-  {
+ protected:
+  void Init() {
     memset(static_cast(this), 0, sizeof(struct_type));
     attached_to_ = NULL;
     traits::init(this);
@@ -150,8 +140,8 @@ struct CefRectTraits {
   static inline void init(struct_type* s) {}
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     *target = *src;
   }
 };
@@ -159,33 +149,28 @@ struct CefRectTraits {
 ///
 // Class representing a rectangle.
 ///
-class CefRect : public CefStructBase
-{
-public:
+class CefRect : public CefStructBase {
+ public:
   typedef CefStructBase parent;
 
   CefRect() : parent() {}
-  CefRect(const cef_rect_t& r) : parent(r) {}
-  CefRect(const CefRect& r) : parent(r) {}
-  CefRect(int x, int y, int width, int height) : parent()
-  {
+  CefRect(const cef_rect_t& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefRect(const CefRect& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefRect(int x, int y, int width, int height) : parent() {
     Set(x, y, width, height);
   }
 
   bool IsEmpty() const { return width <= 0 || height <= 0; }
-  void Set(int x, int y, int width, int height)
-  {
+  void Set(int x, int y, int width, int height) {
     this->x = x, this->y = y, this->width = width, this->height = height;
   }
 };
 
-inline bool operator==(const CefRect& a, const CefRect& b)
-{
+inline bool operator==(const CefRect& a, const CefRect& b) {
   return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
 }
 
-inline bool operator!=(const CefRect& a, const CefRect& b)
-{
+inline bool operator!=(const CefRect& a, const CefRect& b) {
   return !(a == b);
 }
 
@@ -196,8 +181,8 @@ struct CefPrintOptionsTraits {
   static inline void init(struct_type* s) {}
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     *target = *src;
   }
 };
@@ -212,8 +197,7 @@ typedef CefStructBase CefPrintOptions;
 struct CefPopupFeaturesTraits {
   typedef cef_popup_features_t struct_type;
 
-  static inline void init(struct_type* s)
-  {
+  static inline void init(struct_type* s) {
     s->menuBarVisible = true;
     s->statusBarVisible = true;
     s->toolBarVisible = true;
@@ -221,16 +205,15 @@ struct CefPopupFeaturesTraits {
     s->scrollbarsVisible = true;
     s->resizable = true;
   }
-  
-  static inline void clear(struct_type* s)
-  {
-    if(s->additionalFeatures)
+
+  static inline void clear(struct_type* s) {
+    if (s->additionalFeatures)
       cef_string_list_free(s->additionalFeatures);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
-    if(target->additionalFeatures)
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    if (target->additionalFeatures)
       cef_string_list_free(target->additionalFeatures);
     target->additionalFeatures = src->additionalFeatures ?
         cef_string_list_copy(src->additionalFeatures) : NULL;
@@ -263,25 +246,23 @@ typedef CefStructBase CefPopupFeatures;
 struct CefSettingsTraits {
   typedef cef_settings_t struct_type;
 
-  static inline void init(struct_type* s)
-  {
+  static inline void init(struct_type* s) {
     s->size = sizeof(struct_type);
   }
-  
-  static inline void clear(struct_type* s)
-  {
+
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->cache_path);
     cef_string_clear(&s->user_agent);
     cef_string_clear(&s->product_version);
     cef_string_clear(&s->locale);
-    if(s->extra_plugin_paths)
+    if (s->extra_plugin_paths)
       cef_string_list_free(s->extra_plugin_paths);
     cef_string_clear(&s->log_file);
     cef_string_clear(&s->javascript_flags);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->multi_threaded_message_loop = src->multi_threaded_message_loop;
 
     cef_string_set(src->cache_path.str, src->cache_path.length,
@@ -292,7 +273,7 @@ struct CefSettingsTraits {
         &target->product_version, copy);
     cef_string_set(src->locale.str, src->locale.length, &target->locale, copy);
 
-    if(target->extra_plugin_paths)
+    if (target->extra_plugin_paths)
       cef_string_list_free(target->extra_plugin_paths);
     target->extra_plugin_paths = src->extra_plugin_paths ?
         cef_string_list_copy(src->extra_plugin_paths) : NULL;
@@ -322,13 +303,11 @@ typedef CefStructBase CefSettings;
 struct CefBrowserSettingsTraits {
   typedef cef_browser_settings_t struct_type;
 
-  static inline void init(struct_type* s)
-  {
+  static inline void init(struct_type* s) {
     s->size = sizeof(struct_type);
   }
-  
-  static inline void clear(struct_type* s)
-  {
+
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->standard_font_family);
     cef_string_clear(&s->fixed_font_family);
     cef_string_clear(&s->serif_font_family);
@@ -339,8 +318,8 @@ struct CefBrowserSettingsTraits {
     cef_string_clear(&s->user_style_sheet_location);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->drag_drop_disabled = src->drag_drop_disabled;
     target->load_drops_disabled = src->load_drops_disabled;
     target->history_disabled = src->history_disabled;
@@ -431,9 +410,8 @@ struct CefURLPartsTraits {
   typedef cef_urlparts_t struct_type;
 
   static inline void init(struct_type* s) {}
-  
-  static inline void clear(struct_type* s)
-  {
+
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->spec);
     cef_string_clear(&s->scheme);
     cef_string_clear(&s->username);
@@ -444,8 +422,8 @@ struct CefURLPartsTraits {
     cef_string_clear(&s->query);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     cef_string_set(src->spec.str, src->spec.length, &target->spec, copy);
     cef_string_set(src->scheme.str, src->scheme.length, &target->scheme, copy);
     cef_string_set(src->username.str, src->username.length, &target->username,
@@ -469,11 +447,11 @@ struct CefTimeTraits {
   typedef cef_time_t struct_type;
 
   static inline void init(struct_type* s) {}
-  
+
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     *target = *src;
   }
 };
@@ -481,15 +459,15 @@ struct CefTimeTraits {
 ///
 // Class representing a time.
 ///
-class CefTime : public CefStructBase
-{
-public:
+class CefTime : public CefStructBase {
+ public:
   typedef CefStructBase parent;
 
   CefTime() : parent() {}
-  CefTime(const cef_time_t& r) : parent(r) {}
-  CefTime(time_t r) : parent() { SetTimeT(r); }
-  CefTime(double r) : parent() { SetDoubleT(r); }
+  CefTime(const cef_time_t& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefTime(const CefTime& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  explicit CefTime(time_t r) : parent() { SetTimeT(r); }
+  explicit CefTime(double r) : parent() { SetDoubleT(r); }
 
   // Converts to/from time_t.
   void SetTimeT(time_t r) {
@@ -519,17 +497,16 @@ struct CefCookieTraits {
   typedef cef_cookie_t struct_type;
 
   static inline void init(struct_type* s) {}
-  
-  static inline void clear(struct_type* s)
-  {
+
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->name);
     cef_string_clear(&s->value);
     cef_string_clear(&s->domain);
     cef_string_clear(&s->path);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     cef_string_set(src->name.str, src->name.length, &target->name, copy);
     cef_string_set(src->value.str, src->value.length, &target->value, copy);
     cef_string_set(src->domain.str, src->domain.length, &target->domain, copy);
@@ -554,8 +531,7 @@ struct CefMenuInfoTraits {
 
   static inline void init(struct_type* s) {}
 
-  static inline void clear(struct_type* s)
-  {
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->linkUrl);
     cef_string_clear(&s->imageUrl);
     cef_string_clear(&s->pageUrl);
@@ -565,8 +541,8 @@ struct CefMenuInfoTraits {
     cef_string_clear(&s->securityInfo);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->typeFlags = src->typeFlags;
     target->x = src->x;
     target->y = src->y;
@@ -600,14 +576,13 @@ struct CefProxyInfoTraits {
   typedef cef_proxy_info_t struct_type;
 
   static inline void init(struct_type* s) {}
-  
-  static inline void clear(struct_type* s)
-  {
+
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->proxyList);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->proxyType = src->proxyType;
     cef_string_set(src->proxyList.str, src->proxyList.length,
         &target->proxyList, copy);
@@ -617,14 +592,12 @@ struct CefProxyInfoTraits {
 ///
 // Class representing the results of proxy resolution.
 ///
-class CefProxyInfo : public CefStructBase
-{
-public:
+class CefProxyInfo : public CefStructBase {
+ public:
   ///
   // Use a direction connection instead of a proxy.
   ///
-  void UseDirect()
-  {
+  void UseDirect() {
     proxyType = PROXY_TYPE_DIRECT;
   }
 
@@ -637,8 +610,7 @@ public:
   // Multiple values may be separated by semicolons or whitespace. For example,
   // "foo1:80;foo2:80".
   ///
-  void UseNamedProxy(const CefString& proxy_uri_list)
-  {
+  void UseNamedProxy(const CefString& proxy_uri_list) {
     proxyType = PROXY_TYPE_NAMED;
     (CefString(&proxyList)) = proxy_uri_list;
   }
@@ -647,8 +619,7 @@ public:
   // Use one or more named proxy servers specified in PAC script format. For
   // example, "PROXY foobar:99; SOCKS fml:2; DIRECT".
   ///
-  void UsePacString(const CefString& pac_string)
-  {
+  void UsePacString(const CefString& pac_string) {
     proxyType = PROXY_TYPE_PAC_STRING;
     (CefString(&proxyList)) = pac_string;
   }
@@ -660,4 +631,4 @@ public:
   CefString ProxyList() const { return CefString(&proxyList); }
 };
 
-#endif // _CEF_TYPES_WRAPPERS_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_
diff --git a/include/internal/cef_win.h b/include/internal/cef_win.h
index bbdf034ca..9a89f4a7c 100644
--- a/include/internal/cef_win.h
+++ b/include/internal/cef_win.h
@@ -28,13 +28,14 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-#ifndef _CEF_WIN_H
-#define _CEF_WIN_H
+#ifndef CEF_INCLUDE_INTERNAL_CEF_WIN_H_
+#define CEF_INCLUDE_INTERNAL_CEF_WIN_H_
+#pragma once
 
 #if defined(OS_WIN)
 #include 
-#include "cef_types_win.h"
-#include "cef_types_wrappers.h"
+#include "include/internal/cef_types_win.h"
+#include "include/internal/cef_types_wrappers.h"
 
 ///
 // Atomic increment and decrement.
@@ -45,24 +46,19 @@
 ///
 // Critical section wrapper.
 ///
-class CefCriticalSection
-{
-public:
-  CefCriticalSection()
-  {
+class CefCriticalSection {
+ public:
+  CefCriticalSection() {
     memset(&m_sec, 0, sizeof(CRITICAL_SECTION));
     InitializeCriticalSection(&m_sec);
   }
-  virtual ~CefCriticalSection()
-  {
+  virtual ~CefCriticalSection() {
     DeleteCriticalSection(&m_sec);
   }
-  void Lock()
-  {
+  void Lock() {
     EnterCriticalSection(&m_sec);
   }
-  void Unlock()
-  {
+  void Unlock() {
     LeaveCriticalSection(&m_sec);
   }
 
@@ -81,13 +77,12 @@ struct CefWindowInfoTraits {
 
   static inline void init(struct_type* s) {}
 
-  static inline void clear(struct_type* s)
-  {
+  static inline void clear(struct_type* s) {
     cef_string_clear(&s->m_windowName);
   }
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->m_dwExStyle = src->m_dwExStyle;
     cef_string_set(src->m_windowName.str, src->m_windowName.length,
         &target->m_windowName, copy);
@@ -107,17 +102,15 @@ struct CefWindowInfoTraits {
 ///
 // Class representing window information.
 ///
-class CefWindowInfo : public CefStructBase
-{
-public:
+class CefWindowInfo : public CefStructBase {
+ public:
   typedef CefStructBase parent;
 
   CefWindowInfo() : parent() {}
-  CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
-  CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
-  
-  void SetAsChild(HWND hWndParent, RECT windowRect)
-  {
+  explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
+  explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
+
+  void SetAsChild(HWND hWndParent, RECT windowRect) {
     m_dwStyle = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP |
                 WS_VISIBLE;
     m_hWndParent = hWndParent;
@@ -127,8 +120,7 @@ public:
     m_nHeight = windowRect.bottom - windowRect.top;
   }
 
-  void SetAsPopup(HWND hWndParent, const CefString& windowName)
-  {
+  void SetAsPopup(HWND hWndParent, const CefString& windowName) {
     m_dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
                 WS_VISIBLE;
     m_hWndParent = hWndParent;
@@ -140,14 +132,12 @@ public:
     cef_string_copy(windowName.c_str(), windowName.length(), &m_windowName);
   }
 
-  void SetAsOffScreen(HWND hWndParent)
-  {
+  void SetAsOffScreen(HWND hWndParent) {
     m_bWindowRenderingDisabled = TRUE;
     m_hWndParent = hWndParent;
   }
 
-  void SetTransparentPainting(BOOL transparentPainting)
-  {
+  void SetTransparentPainting(BOOL transparentPainting) {
     m_bTransparentPainting = transparentPainting;
   }
 };
@@ -159,8 +149,8 @@ struct CefPrintInfoTraits {
   static inline void init(struct_type* s) {}
   static inline void clear(struct_type* s) {}
 
-  static inline void set(const struct_type* src, struct_type* target, bool copy)
-  {
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
     target->m_hDC = src->m_hDC;
     target->m_Rect = src->m_Rect;
     target->m_Scale = src->m_Scale;
@@ -172,6 +162,6 @@ struct CefPrintInfoTraits {
 ///
 typedef CefStructBase CefPrintInfo;
 
-#endif // OS_WIN
+#endif  // OS_WIN
 
-#endif // _CEF_WIN_H
+#endif  // CEF_INCLUDE_INTERNAL_CEF_WIN_H_
diff --git a/include/wrapper/cef_byte_read_handler.h b/include/wrapper/cef_byte_read_handler.h
index d43ef8182..f7ca7a15a 100644
--- a/include/wrapper/cef_byte_read_handler.h
+++ b/include/wrapper/cef_byte_read_handler.h
@@ -33,19 +33,19 @@
 // against the libcef_dll_wrapper target.
 //
 
-#ifndef _CEF_BYTE_READ_HANDLER_H
-#define _CEF_BYTE_READ_HANDLER_H
+#ifndef CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
+#define CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
+#pragma once
 
-#include "../cef_base.h"
-#include "../cef_stream.h"
+#include "include/cef_base.h"
+#include "include/cef_stream.h"
 
 ///
 // Thread safe implementation of the CefReadHandler class for reading an
 // in-memory array of bytes.
 ///
-class CefByteReadHandler : public CefReadHandler
-{
-public:
+class CefByteReadHandler : public CefReadHandler {
+ public:
   ///
   // Create a new object for reading an array of bytes. An optional |source|
   // reference can be kept to keep the underlying data source from being
@@ -63,26 +63,26 @@ public:
   // Seek to the specified offset position. |whence| may be any one of
   // SEEK_CUR, SEEK_END or SEEK_SET.
   ///
-  virtual int Seek(long offset, int whence);
+  virtual int Seek(int64 offset, int whence);
 
   ///
   // Return the current offset position.
   ///
-  virtual long Tell();
+  virtual int64 Tell();
 
   ///
   // Return non-zero if at end of file.
   ///
   virtual int Eof();
 
-private:
+ private:
   const unsigned char* bytes_;
-  size_t size_;
-  size_t offset_;
+  int64 size_;
+  int64 offset_;
   CefRefPtr source_;
 
   IMPLEMENT_REFCOUNTING(CefByteReadHandler);
   IMPLEMENT_LOCKING(CefByteReadHandler);
 };
 
-#endif // _CEF_BYTE_READ_HANDLER_H
+#endif  // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_
diff --git a/include/wrapper/cef_xml_object.h b/include/wrapper/cef_xml_object.h
index 7a8307009..d9f706fde 100644
--- a/include/wrapper/cef_xml_object.h
+++ b/include/wrapper/cef_xml_object.h
@@ -33,11 +33,12 @@
 // against the libcef_dll_wrapper target.
 //
 
-#ifndef _CEF_XML_OBJECT_H
-#define _CEF_XML_OBJECT_H
+#ifndef CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
+#define CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_
+#pragma once
 
-#include "../cef_base.h"
-#include "../cef_xml_reader.h"
+#include "include/cef_base.h"
+#include "include/cef_xml_reader.h"
 #include 
 #include 
 
@@ -66,9 +67,8 @@ class CefStreamReader;
 //     (c) Element nodes are represented by their outer XML string.
 // 
/// -class CefXmlObject : public CefBase -{ -public: +class CefXmlObject : public CefBase { + public: typedef std::vector > ObjectVector; typedef std::map AttributeMap; @@ -76,7 +76,7 @@ public: // Create a new object with the specified name. An object name must always be // at least one character long. /// - CefXmlObject(const CefString& name); + explicit CefXmlObject(const CefString& name); virtual ~CefXmlObject(); /// @@ -172,7 +172,7 @@ public: /// size_t FindChildren(const CefString& name, ObjectVector& children); -private: + private: void SetParent(CefXmlObject* parent); CefString name_; @@ -185,4 +185,4 @@ private: IMPLEMENT_LOCKING(CefXmlObject); }; -#endif // _CEF_XML_OBJECT_H +#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ diff --git a/include/wrapper/cef_zip_archive.h b/include/wrapper/cef_zip_archive.h index c9ae4097e..b58dbca01 100644 --- a/include/wrapper/cef_zip_archive.h +++ b/include/wrapper/cef_zip_archive.h @@ -33,10 +33,11 @@ // against the libcef_dll_wrapper target. // -#ifndef _CEF_ZIP_ARCHIVE_H -#define _CEF_ZIP_ARCHIVE_H +#ifndef CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ +#define CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ +#pragma once -#include "../cef_base.h" +#include "include/cef_base.h" #include class CefStreamReader; @@ -52,16 +53,14 @@ class CefStreamReader; // means that files from the same folder may not be located together in the // file content map. /// -class CefZipArchive : public CefBase -{ -public: +class CefZipArchive : public CefBase { + public: /// // Class representing a file in the archive. Accessing the file data from // multiple threads is safe provided a reference to the File object is kept. /// - class File : public CefBase - { - public: + class File : public CefBase { + public: /// // Returns the read-only data contained in the file. /// @@ -123,11 +122,11 @@ public: /// size_t GetFiles(FileMap& map); -private: + private: FileMap contents_; IMPLEMENT_REFCOUNTING(CefZipArchive); IMPLEMENT_LOCKING(CefZipArchive); }; -#endif // _CEF_ZIP_ARCHIVE_H +#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ diff --git a/libcef/browser_appcache_system.cc b/libcef/browser_appcache_system.cc index aeace3d42..5ae63ffff 100644 --- a/libcef/browser_appcache_system.cc +++ b/libcef/browser_appcache_system.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_appcache_system.h" -#include "browser_resource_loader_bridge.h" +#include "libcef/browser_appcache_system.h" +#include "libcef/browser_resource_loader_bridge.h" #include #include @@ -347,7 +347,7 @@ class BrowserBackendProxy }; -// BrowserAppCacheSystem -------------------------------------------------------- +// BrowserAppCacheSystem ------------------------------------------------------- // This class only works for a single process browser. static const int kSingleProcessId = 1; diff --git a/libcef/browser_appcache_system.h b/libcef/browser_appcache_system.h index d81d9d2dd..cf2cbac04 100644 --- a/libcef/browser_appcache_system.h +++ b/libcef/browser_appcache_system.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_APPCACHE_SYSTEM_H -#define _BROWSER_APPCACHE_SYSTEM_H +#ifndef CEF_LIBCEF_BROWSER_APPCACHE_SYSTEM_H_ +#define CEF_LIBCEF_BROWSER_APPCACHE_SYSTEM_H_ +#pragma once #include "base/file_path.h" #include "base/message_loop.h" @@ -129,4 +130,4 @@ class BrowserAppCacheSystem { static BrowserAppCacheSystem* instance_; }; -#endif // _BROWSER_APPCACHE_SYSTEM_H +#endif // CEF_LIBCEF_BROWSER_APPCACHE_SYSTEM_H_ diff --git a/libcef/browser_database_system.cc b/libcef/browser_database_system.cc index 1f770eb00..1849282c2 100644 --- a/libcef/browser_database_system.cc +++ b/libcef/browser_database_system.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_database_system.h" +#include "libcef/browser_database_system.h" #include "base/auto_reset.h" #include "base/bind.h" @@ -55,7 +55,8 @@ BrowserDatabaseSystem::~BrowserDatabaseSystem() { instance_ = NULL; } -void BrowserDatabaseSystem::databaseOpened(const WebKit::WebDatabase& database) { +void BrowserDatabaseSystem::databaseOpened( + const WebKit::WebDatabase& database) { string16 origin_identifier = database.securityOrigin().databaseIdentifier(); string16 database_name = database.name(); open_connections_->AddOpenConnection(origin_identifier, database_name); @@ -78,7 +79,8 @@ void BrowserDatabaseSystem::databaseModified( database.name())); } -void BrowserDatabaseSystem::databaseClosed(const WebKit::WebDatabase& database) { +void BrowserDatabaseSystem::databaseClosed( + const WebKit::WebDatabase& database) { string16 origin_identifier = database.securityOrigin().databaseIdentifier(); string16 database_name = database.name(); db_thread_proxy_->PostTask( diff --git a/libcef/browser_database_system.h b/libcef/browser_database_system.h index e84f82edd..c2af46f69 100644 --- a/libcef/browser_database_system.h +++ b/libcef/browser_database_system.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_DATABASE_SYSTEM_H -#define _BROWSER_DATABASE_SYSTEM_H +#ifndef CEF_LIBCEF_BROWSER_DATABASE_SYSTEM_H_ +#define CEF_LIBCEF_BROWSER_DATABASE_SYSTEM_H_ +#pragma once #include "base/file_path.h" #include "base/hash_tables.h" @@ -101,4 +102,4 @@ class BrowserDatabaseSystem : public webkit_database::DatabaseTracker::Observer, static BrowserDatabaseSystem* instance_; }; -#endif // _BROWSER_DATABASE_SYSTEM_H +#endif // CEF_LIBCEF_BROWSER_DATABASE_SYSTEM_H_ diff --git a/libcef/browser_devtools_agent.cc b/libcef/browser_devtools_agent.cc index 943b7816b..68a0c20e2 100644 --- a/libcef/browser_devtools_agent.cc +++ b/libcef/browser_devtools_agent.cc @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_devtools_agent.h" +#include "libcef/browser_devtools_agent.h" +#include "libcef/browser_devtools_callargs.h" +#include "libcef/browser_devtools_client.h" #include "base/bind.h" #include "base/message_loop.h" #include "grit/webkit_chromium_resources.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" -#include "browser_devtools_callargs.h" -#include "browser_devtools_client.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebCString; @@ -41,7 +41,7 @@ class WebKitClientMessageLoopImpl MessageLoop* message_loop_; }; -} // namespace +} // namespace BrowserDevToolsAgent::BrowserDevToolsAgent() : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), @@ -70,7 +70,7 @@ int BrowserDevToolsAgent::hostIdentifier() { void BrowserDevToolsAgent::runtimePropertyChanged( const WebKit::WebString& name, const WebKit::WebString& value) { - // TODO: Implement. + // TODO(cef): Implement. } WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop* @@ -102,7 +102,7 @@ WebDevToolsAgent* BrowserDevToolsAgent::GetWebAgent() { void BrowserDevToolsAgent::attach(BrowserDevToolsClient* client) { DCHECK(!dev_tools_client_); dev_tools_client_ = client; - WebDevToolsAgent *web_agent = GetWebAgent(); + WebDevToolsAgent* web_agent = GetWebAgent(); if (web_agent) web_agent->attach(); } @@ -116,7 +116,7 @@ void BrowserDevToolsAgent::detach() { } bool BrowserDevToolsAgent::evaluateInWebInspector( - long call_id, + long call_id, // NOLINT(runtime/int) const std::string& script) { WebDevToolsAgent* agent = GetWebAgent(); if (!agent) diff --git a/libcef/browser_devtools_agent.h b/libcef/browser_devtools_agent.h index 3882a0265..95d9a9d88 100644 --- a/libcef/browser_devtools_agent.h +++ b/libcef/browser_devtools_agent.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_DEVTOOLS_AGENT_H -#define _BROWSER_DEVTOOLS_AGENT_H +#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_AGENT_H_ +#define CEF_LIBCEF_BROWSER_DEVTOOLS_AGENT_H_ +#pragma once #include @@ -44,7 +45,8 @@ class BrowserDevToolsAgent : public WebKit::WebDevToolsAgentClient { void attach(BrowserDevToolsClient* client); void detach(); - bool evaluateInWebInspector(long call_id, const std::string& script); + bool evaluateInWebInspector(long call_id, // NOLINT(runtime/int) + const std::string& script); BrowserDevToolsClient* client() { return dev_tools_client_; } @@ -61,4 +63,4 @@ class BrowserDevToolsAgent : public WebKit::WebDevToolsAgentClient { DISALLOW_COPY_AND_ASSIGN(BrowserDevToolsAgent); }; -#endif // _BROWSER_DEVTOOLS_AGENT_H +#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_AGENT_H_ diff --git a/libcef/browser_devtools_callargs.cc b/libcef/browser_devtools_callargs.cc index e17b3c4dd..efc8013f8 100644 --- a/libcef/browser_devtools_callargs.cc +++ b/libcef/browser_devtools_callargs.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_devtools_callargs.h" +#include "libcef/browser_devtools_callargs.h" #include "base/logging.h" @@ -23,5 +23,5 @@ BrowserDevToolsCallArgs::BrowserDevToolsCallArgs( BrowserDevToolsCallArgs::~BrowserDevToolsCallArgs() { --calls_count_; - DCHECK(calls_count_ >= 0); + DCHECK_GE(calls_count_, 0); } diff --git a/libcef/browser_devtools_callargs.h b/libcef/browser_devtools_callargs.h index c4c84224c..b53de58df 100644 --- a/libcef/browser_devtools_callargs.h +++ b/libcef/browser_devtools_callargs.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_DEVTOOLS_CALLARGS_H -#define _BROWSER_DEVTOOLS_CALLARGS_H +#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_CALLARGS_H_ +#define CEF_LIBCEF_BROWSER_DEVTOOLS_CALLARGS_H_ +#pragma once #include "base/basictypes.h" @@ -25,4 +26,4 @@ class BrowserDevToolsCallArgs { static int calls_count_; }; -#endif // _BROWSER_DEVTOOLS_CALLARGS_H +#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_CALLARGS_H_ diff --git a/libcef/browser_devtools_client.cc b/libcef/browser_devtools_client.cc index fd9210f18..770df0312 100644 --- a/libcef/browser_devtools_client.cc +++ b/libcef/browser_devtools_client.cc @@ -2,6 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "libcef/browser_devtools_client.h" +#include "libcef/browser_devtools_agent.h" +#include "libcef/browser_devtools_callargs.h" +#include "libcef/browser_impl.h" +#include "libcef/cef_context.h" + #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontend.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -9,15 +15,9 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" -#undef LOG -#include "browser_devtools_agent.h" -#include "browser_devtools_callargs.h" -#include "browser_devtools_client.h" -#include "browser_impl.h" -#include "cef_context.h" - #include "base/bind.h" #include "base/command_line.h" +#include "base/logging.h" #include "base/message_loop.h" using WebKit::WebDevToolsAgent; @@ -27,7 +27,7 @@ using WebKit::WebString; using WebKit::WebView; BrowserDevToolsClient::BrowserDevToolsClient(CefBrowserImpl* browser, - BrowserDevToolsAgent *agent) + BrowserDevToolsAgent* agent) : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), browser_(browser), dev_tools_agent_(agent), diff --git a/libcef/browser_devtools_client.h b/libcef/browser_devtools_client.h index 2f55cbab7..b53c2ff7b 100644 --- a/libcef/browser_devtools_client.h +++ b/libcef/browser_devtools_client.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_DEVTOOLS_CLIENT_H -#define _BROWSER_DEVTOOLS_CLIENT_H +#ifndef CEF_LIBCEF_BROWSER_DEVTOOLS_CLIENT_H_ +#define CEF_LIBCEF_BROWSER_DEVTOOLS_CLIENT_H_ +#pragma once #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -12,17 +13,15 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsFrontendClient.h" namespace WebKit { - class WebDevToolsFrontend; - -} // namespace WebKit +class WebView; +} // namespace WebKit class BrowserDevToolsCallArgs; class BrowserDevToolsAgent; class CefBrowserImpl; class BrowserDevToolsClient: public WebKit::WebDevToolsFrontendClient { - public: BrowserDevToolsClient(CefBrowserImpl* browser, BrowserDevToolsAgent* agent); @@ -54,4 +53,4 @@ class BrowserDevToolsClient: public WebKit::WebDevToolsFrontendClient { DISALLOW_COPY_AND_ASSIGN(BrowserDevToolsClient); }; -#endif // _BROWSER_DEVTOOLS_CLIENT_H +#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_CLIENT_H_ diff --git a/libcef/browser_devtools_scheme_handler.cc b/libcef/browser_devtools_scheme_handler.cc index bf92c8b6f..2a1b58979 100644 --- a/libcef/browser_devtools_scheme_handler.cc +++ b/libcef/browser_devtools_scheme_handler.cc @@ -2,15 +2,17 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "browser_devtools_scheme_handler.h" +#include "libcef/browser_devtools_scheme_handler.h" + +#include + #include "include/cef_browser.h" #include "include/cef_request.h" #include "include/cef_response.h" #include "include/cef_scheme.h" #include "include/cef_stream.h" #include "include/cef_url.h" -#include "browser_webkit_glue.h" -#include +#include "libcef/browser_webkit_glue.h" #include "base/file_util.h" #include "base/string_util.h" @@ -24,32 +26,28 @@ const char kChromeDevToolsURL[] = "chrome-devtools://devtools/"; namespace { -class DevToolsSchemeHandler : public CefSchemeHandler -{ -public: +class DevToolsSchemeHandler : public CefSchemeHandler { + public: DevToolsSchemeHandler(const std::string& path, CefRefPtr reader, int size) - : path_(path), reader_(reader), size_(size) - { + : path_(path), reader_(reader), size_(size) { } virtual bool ProcessRequest(CefRefPtr request, CefRefPtr callback) - OVERRIDE - { + OVERRIDE { callback->HeadersAvailable(); return true; } - + virtual void GetResponseHeaders(CefRefPtr response, int64& response_length, - CefString& redirectUrl) OVERRIDE - { + CefString& redirectUrl) OVERRIDE { response_length = size_; std::string mime_type = "text/plain"; - if(net::GetMimeTypeFromFile(FilePath(CefString(path_)), &mime_type)) + if (net::GetMimeTypeFromFile(FilePath(CefString(path_)), &mime_type)) response->SetMimeType(mime_type); response->SetStatus(200); @@ -59,17 +57,15 @@ public: int bytes_to_read, int& bytes_read, CefRefPtr callback) - OVERRIDE - { + OVERRIDE { bytes_read = reader_->Read(data_out, 1, bytes_to_read); return (bytes_read > 0); } - virtual void Cancel() OVERRIDE - { + virtual void Cancel() OVERRIDE { } -private: + private: std::string path_; CefRefPtr reader_; int size_; @@ -77,16 +73,14 @@ private: IMPLEMENT_REFCOUNTING(DevToolSSchemeHandler); }; -class DevToolsSchemeHandlerFactory : public CefSchemeHandlerFactory -{ -public: +class DevToolsSchemeHandlerFactory : public CefSchemeHandlerFactory { + public: DevToolsSchemeHandlerFactory() {} virtual CefRefPtr Create(CefRefPtr browser, const CefString& scheme_name, CefRefPtr request) - OVERRIDE - { + OVERRIDE { // Remove the query component of the URL, if any. CefURLParts parts; CefParseURL(request->GetURL(), parts); @@ -106,10 +100,9 @@ public: return new DevToolsSchemeHandler(path, reader, size); } - CefRefPtr GetStreamReader(const char* path, int& size) - { + CefRefPtr GetStreamReader(const char* path, int& size) { // Create a stream for the grit resource. - for(size_t i = 0; i < kDevtoolsResourcesSize; ++i) { + for (size_t i = 0; i < kDevtoolsResourcesSize; ++i) { if (base::strcasecmp(kDevtoolsResources[i].name, path) == 0) { base::StringPiece piece = webkit_glue::GetDataResource(kDevtoolsResources[i].value); @@ -121,18 +114,17 @@ public: } } - NOTREACHED() << "Missing DevTools resource: "< - #include +#include "libcef/browser_impl.h" +#include "libcef/browser_webview_delegate.h" +#include "libcef/cef_thread.h" +#include "libcef/drag_download_file.h" +#include "libcef/drag_download_util.h" +#include "libcef/download_util.h" +#include "libcef/web_drag_source_win.h" +#include "libcef/web_drag_utils_win.h" +#include "libcef/web_drop_target_win.h" + #include "base/utf_string_conversions.h" #include "net/base/file_stream.h" #include "net/base/net_util.h" @@ -89,8 +89,8 @@ class DragDropThread : public base::Thread { } private: - // Hold a reference count to BrowserDragDelegate to make sure that it is always - // alive in the thread lifetime. + // Hold a reference count to BrowserDragDelegate to make sure that it is + // always alive in the thread lifetime. scoped_refptr drag_handler_; DISALLOW_COPY_AND_ASSIGN(DragDropThread); diff --git a/libcef/browser_drag_delegate_win.h b/libcef/browser_drag_delegate_win.h index 4d0d8e9d0..25290d533 100644 --- a/libcef/browser_drag_delegate_win.h +++ b/libcef/browser_drag_delegate_win.h @@ -3,10 +3,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_DRAG_DELEGATE_WIN_H -#define _BROWSER_DRAG_DELEGATE_WIN_H +#ifndef CEF_LIBCEF_BROWSER_DRAG_DELEGATE_WIN_H_ +#define CEF_LIBCEF_BROWSER_DRAG_DELEGATE_WIN_H_ #pragma once +#include + #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/threading/platform_thread.h" @@ -99,4 +101,4 @@ class BrowserDragDelegate }; -#endif // _BROWSER_DRAG_DELEGATE_WIN_H +#endif // CEF_LIBCEF_BROWSER_DRAG_DELEGATE_WIN_H_ diff --git a/libcef/browser_file_system.cc b/libcef/browser_file_system.cc index a08457153..a8d59696c 100644 --- a/libcef/browser_file_system.cc +++ b/libcef/browser_file_system.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_file_system.h" -#include "browser_file_writer.h" -#include "cef_thread.h" +#include "libcef/browser_file_system.h" +#include "libcef/browser_file_writer.h" +#include "libcef/cef_thread.h" #include "base/file_path.h" #include "base/memory/scoped_callback_factory.h" @@ -150,7 +150,7 @@ void BrowserFileSystem::CreateContext() { void BrowserFileSystem::OpenFileSystem( WebFrame* frame, WebFileSystem::Type web_filesystem_type, - long long, bool create, + long long, bool create, // NOLINT(runtime/int) WebFileSystemCallbacks* callbacks) { if (!frame || !file_system_context_.get()) { // The FileSystem temp directory was not initialized successfully. @@ -159,13 +159,13 @@ void BrowserFileSystem::OpenFileSystem( } fileapi::FileSystemType type; - if (web_filesystem_type == WebFileSystem::TypeTemporary) + if (web_filesystem_type == WebFileSystem::TypeTemporary) { type = fileapi::kFileSystemTypeTemporary; - else if (web_filesystem_type == WebFileSystem::TypePersistent) + } else if (web_filesystem_type == WebFileSystem::TypePersistent) { type = fileapi::kFileSystemTypePersistent; - else if (web_filesystem_type == WebFileSystem::TypeExternal) + } else if (web_filesystem_type == WebFileSystem::TypeExternal) { type = fileapi::kFileSystemTypeExternal; - else { + } else { // Unknown type filesystem is requested. callbacks->didFail(WebKit::WebFileErrorSecurity); return; diff --git a/libcef/browser_file_system.h b/libcef/browser_file_system.h index d034eec5f..87e13812e 100644 --- a/libcef/browser_file_system.h +++ b/libcef/browser_file_system.h @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BROWSER_FILE_SYSTEM_H_ -#define BROWSER_FILE_SYSTEM_H_ +#ifndef CEF_LIBCEF_BROWSER_FILE_SYSTEM_H_ +#define CEF_LIBCEF_BROWSER_FILE_SYSTEM_H_ +#pragma once + +#include #include "base/file_util_proxy.h" #include "base/id_map.h" @@ -11,7 +14,6 @@ #include "base/scoped_temp_dir.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSystem.h" #include "webkit/fileapi/file_system_types.h" -#include namespace WebKit { class WebFileSystemCallbacks; @@ -35,7 +37,7 @@ class BrowserFileSystem void OpenFileSystem(WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, - long long size, + long long size, // NOLINT(runtime/int) bool create, WebKit::WebFileSystemCallbacks* callbacks); @@ -94,4 +96,4 @@ class BrowserFileSystem DISALLOW_COPY_AND_ASSIGN(BrowserFileSystem); }; -#endif // BROWSER_FILE_SYSTEM_H_ +#endif // CEF_LIBCEF_BROWSER_FILE_SYSTEM_H_ diff --git a/libcef/browser_file_writer.cc b/libcef/browser_file_writer.cc index 4b4c33065..c1d5a6c50 100644 --- a/libcef/browser_file_writer.cc +++ b/libcef/browser_file_writer.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_file_writer.h" -#include "cef_thread.h" +#include "libcef/browser_file_writer.h" +#include "libcef/cef_thread.h" #include "base/bind.h" #include "base/logging.h" diff --git a/libcef/browser_file_writer.h b/libcef/browser_file_writer.h index d4f597150..99c020727 100644 --- a/libcef/browser_file_writer.h +++ b/libcef/browser_file_writer.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BROWSER_FILE_WRITER_H_ -#define BROWSER_FILE_WRITER_H_ +#ifndef CEF_LIBCEF_BROWSER_FILE_WRITER_H_ +#define CEF_LIBCEF_BROWSER_FILE_WRITER_H_ +#pragma once #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -48,4 +49,4 @@ class BrowserFileWriter : public fileapi::WebFileWriterBase, static net::URLRequestContext* request_context_; }; -#endif // BROWSER_FILE_WRITER_H_ +#endif // CEF_LIBCEF_BROWSER_FILE_WRITER_H_ diff --git a/libcef/browser_impl.cc b/libcef/browser_impl.cc index e7ed38e8b..c5c50ac23 100644 --- a/libcef/browser_impl.cc +++ b/libcef/browser_impl.cc @@ -3,15 +3,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_impl.h" -#include "browser_devtools_scheme_handler.h" -#include "browser_webkit_glue.h" -#include "browser_zoom_map.h" -#include "cef_context.h" -#include "dom_document_impl.h" -#include "request_impl.h" -#include "stream_impl.h" -#include "v8_impl.h" +#include "libcef/browser_impl.h" +#include "libcef/browser_devtools_scheme_handler.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/browser_zoom_map.h" +#include "libcef/cef_context.h" +#include "libcef/dom_document_impl.h" +#include "libcef/request_impl.h" +#include "libcef/stream_impl.h" +#include "libcef/v8_impl.h" #include "base/file_path.h" #include "base/path_service.h" @@ -50,9 +50,8 @@ using WebKit::WebView; namespace { -class CreateBrowserHelper -{ -public: +class CreateBrowserHelper { + public: CreateBrowserHelper(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, @@ -68,27 +67,24 @@ public: CefBrowserSettings settings_; }; -void UIT_CreateBrowserWithHelper(CreateBrowserHelper* helper) -{ +void UIT_CreateBrowserWithHelper(CreateBrowserHelper* helper) { CefBrowser::CreateBrowserSync(helper->window_info_, helper->client_, helper->url_, helper->settings_); delete helper; } -} // namespace +} // namespace CefBrowserImpl::PaintDelegate::PaintDelegate(CefBrowserImpl* browser) - : browser_(browser) -{ + : browser_(browser) { } -CefBrowserImpl::PaintDelegate::~PaintDelegate() -{ + +CefBrowserImpl::PaintDelegate::~PaintDelegate() { } void CefBrowserImpl::PaintDelegate::Paint( - bool popup, const std::vector& dirtyRects, const void* buffer) -{ + bool popup, const std::vector& dirtyRects, const void* buffer) { CefRefPtr client = browser_->GetClient(); if (!client.get()) return; @@ -104,8 +100,7 @@ void CefBrowserImpl::PaintDelegate::Paint( bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, - const CefBrowserSettings& settings) -{ + const CefBrowserSettings& settings) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -129,8 +124,7 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, // static CefRefPtr CefBrowser::CreateBrowserSync( CefWindowInfo& windowInfo, CefRefPtr client, - const CefString& url, const CefBrowserSettings& settings) -{ + const CefString& url, const CefBrowserSettings& settings) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -180,7 +174,7 @@ CefBrowserImpl::CefBrowserImpl(const CefWindowInfo& windowInfo, , opener_was_disabled_by_modal_loop_(false), internal_modal_message_loop_is_active_(false) #endif -{ +{ // NOLINT(whitespace/braces) delegate_.reset(new BrowserWebViewDelegate(this)); popup_delegate_.reset(new BrowserWebViewDelegate(this)); nav_controller_.reset(new BrowserNavigationController(this)); @@ -192,43 +186,37 @@ CefBrowserImpl::CefBrowserImpl(const CefWindowInfo& windowInfo, } } -void CefBrowserImpl::CloseBrowser() -{ +void CefBrowserImpl::CloseBrowser() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_CloseBrowser)); } -void CefBrowserImpl::GoBack() -{ + +void CefBrowserImpl::GoBack() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_BACK)); } -void CefBrowserImpl::GoForward() -{ +void CefBrowserImpl::GoForward() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_FORWARD)); } -void CefBrowserImpl::Reload() -{ +void CefBrowserImpl::Reload() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_RELOAD)); } -void CefBrowserImpl::ReloadIgnoreCache() -{ +void CefBrowserImpl::ReloadIgnoreCache() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_RELOAD_NOCACHE)); } -void CefBrowserImpl::StopLoad() -{ +void CefBrowserImpl::StopLoad() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_STOP)); } -void CefBrowserImpl::SetFocus(bool enable) -{ +void CefBrowserImpl::SetFocus(bool enable) { if (CefThread::CurrentlyOn(CefThread::UI)) { UIT_SetFocus(UIT_GetWebViewHost(), enable); } else { @@ -237,44 +225,41 @@ void CefBrowserImpl::SetFocus(bool enable) } } -CefRefPtr CefBrowserImpl::GetFocusedFrame() -{ +CefRefPtr CefBrowserImpl::GetFocusedFrame() { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return NULL; } - + WebView* view = UIT_GetWebView(); return view ? UIT_GetCefFrame(view->focusedFrame()) : NULL; } -CefRefPtr CefBrowserImpl::GetFrame(const CefString& name) -{ +CefRefPtr CefBrowserImpl::GetFrame(const CefString& name) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return NULL; } - + WebView* view = UIT_GetWebView(); if (!view) return NULL; WebFrame* frame = view->findFrameByName(string16(name)); - if(frame) + if (frame) return UIT_GetCefFrame(frame); return NULL; } -void CefBrowserImpl::GetFrameNames(std::vector& names) -{ +void CefBrowserImpl::GetFrameNames(std::vector& names) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return; } - + WebView* view = UIT_GetWebView(); if (!view) return; @@ -282,7 +267,7 @@ void CefBrowserImpl::GetFrameNames(std::vector& names) WebFrame* main_frame = view->mainFrame(); WebFrame* it = main_frame; do { - if(it != main_frame) { + if (it != main_frame) { string16 str = it->name(); names.push_back(str); } @@ -291,8 +276,7 @@ void CefBrowserImpl::GetFrameNames(std::vector& names) } void CefBrowserImpl::Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) -{ + bool forward, bool matchCase, bool findNext) { WebKit::WebFindOptions options; options.forward = forward; options.matchCase = matchCase; @@ -303,21 +287,18 @@ void CefBrowserImpl::Find(int identifier, const CefString& searchText, &CefBrowserImpl::UIT_Find, identifier, searchText, options)); } -void CefBrowserImpl::StopFinding(bool clearSelection) -{ +void CefBrowserImpl::StopFinding(bool clearSelection) { // Execute the request on the UI thread. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_StopFinding, clearSelection)); } -void CefBrowserImpl::SetZoomLevel(double zoomLevel) -{ +void CefBrowserImpl::SetZoomLevel(double zoomLevel) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_SetZoomLevel, zoomLevel)); } -void CefBrowserImpl::ClearHistory() -{ +void CefBrowserImpl::ClearHistory() { if (CefThread::CurrentlyOn(CefThread::UI)) { bool old_can_go_back = !nav_controller_->IsAtStart(); bool old_can_go_forward = !nav_controller_->IsAtEnd(); @@ -339,20 +320,17 @@ void CefBrowserImpl::ClearHistory() } } -void CefBrowserImpl::ShowDevTools() -{ +void CefBrowserImpl::ShowDevTools() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_ShowDevTools)); } -void CefBrowserImpl::CloseDevTools() -{ +void CefBrowserImpl::CloseDevTools() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_CloseDevTools)); } -bool CefBrowserImpl::GetSize(PaintElementType type, int& width, int& height) -{ +bool CefBrowserImpl::GetSize(PaintElementType type, int& width, int& height) { if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return false; @@ -360,13 +338,13 @@ bool CefBrowserImpl::GetSize(PaintElementType type, int& width, int& height) width = height = 0; - if(type == PET_VIEW) { + if (type == PET_VIEW) { WebViewHost* host = UIT_GetWebViewHost(); if (host) { host->GetSize(width, height); return true; } - } else if(type == PET_POPUP) { + } else if (type == PET_POPUP) { if (popuphost_) { popuphost_->GetSize(width, height); return true; @@ -376,34 +354,30 @@ bool CefBrowserImpl::GetSize(PaintElementType type, int& width, int& height) return false; } -void CefBrowserImpl::SetSize(PaintElementType type, int width, int height) -{ +void CefBrowserImpl::SetSize(PaintElementType type, int width, int height) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_SetSize, type, width, height)); } -bool CefBrowserImpl::IsPopupVisible() -{ +bool CefBrowserImpl::IsPopupVisible() { if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return false; } - + return (popuphost_ != NULL); } -void CefBrowserImpl::HidePopup() -{ +void CefBrowserImpl::HidePopup() { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_ClosePopupWidget)); } -void CefBrowserImpl::Invalidate(const CefRect& dirtyRect) -{ +void CefBrowserImpl::Invalidate(const CefRect& dirtyRect) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, @@ -411,18 +385,17 @@ void CefBrowserImpl::Invalidate(const CefRect& dirtyRect) } bool CefBrowserImpl::GetImage(PaintElementType type, int width, int height, - void* buffer) -{ + void* buffer) { if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return false; } - if(type == PET_VIEW) { + if (type == PET_VIEW) { WebViewHost* host = UIT_GetWebViewHost(); if (host) return host->GetImage(width, height, buffer); - } else if(type == PET_POPUP) { + } else if (type == PET_POPUP) { if (popuphost_) return popuphost_->GetImage(width, height, buffer); } @@ -431,8 +404,7 @@ bool CefBrowserImpl::GetImage(PaintElementType type, int width, int height, } void CefBrowserImpl::SendKeyEvent(KeyType type, int key, int modifiers, - bool sysChar, bool imeChar) -{ + bool sysChar, bool imeChar) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, @@ -441,8 +413,7 @@ void CefBrowserImpl::SendKeyEvent(KeyType type, int key, int modifiers, } void CefBrowserImpl::SendMouseClickEvent(int x, int y, MouseButtonType type, - bool mouseUp, int clickCount) -{ + bool mouseUp, int clickCount) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, @@ -450,167 +421,146 @@ void CefBrowserImpl::SendMouseClickEvent(int x, int y, MouseButtonType type, clickCount)); } -void CefBrowserImpl::SendMouseMoveEvent(int x, int y, bool mouseLeave) -{ +void CefBrowserImpl::SendMouseMoveEvent(int x, int y, bool mouseLeave) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_SendMouseMoveEvent, x, y, mouseLeave)); } -void CefBrowserImpl::SendMouseWheelEvent(int x, int y, int delta) -{ +void CefBrowserImpl::SendMouseWheelEvent(int x, int y, int delta) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_SendMouseWheelEvent, x, y, delta)); } -void CefBrowserImpl::SendFocusEvent(bool setFocus) -{ +void CefBrowserImpl::SendFocusEvent(bool setFocus) { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_SendFocusEvent, setFocus)); } -void CefBrowserImpl::SendCaptureLostEvent() -{ +void CefBrowserImpl::SendCaptureLostEvent() { // Intentially post event tasks in all cases so that painting tasks can be // handled at sane times. CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_SendCaptureLostEvent)); } -void CefBrowserImpl::Undo(CefRefPtr frame) -{ +void CefBrowserImpl::Undo(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_UNDO, frame)); } -void CefBrowserImpl::Redo(CefRefPtr frame) -{ +void CefBrowserImpl::Redo(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_REDO, frame)); } -void CefBrowserImpl::Cut(CefRefPtr frame) -{ +void CefBrowserImpl::Cut(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_CUT, frame)); } -void CefBrowserImpl::Copy(CefRefPtr frame) -{ +void CefBrowserImpl::Copy(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_COPY, frame)); } -void CefBrowserImpl::Paste(CefRefPtr frame) -{ +void CefBrowserImpl::Paste(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_PASTE, frame)); } -void CefBrowserImpl::Delete(CefRefPtr frame) -{ +void CefBrowserImpl::Delete(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_DELETE, frame)); } -void CefBrowserImpl::SelectAll(CefRefPtr frame) -{ +void CefBrowserImpl::SelectAll(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_SELECTALL, frame)); } -void CefBrowserImpl::Print(CefRefPtr frame) -{ +void CefBrowserImpl::Print(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_PRINT, frame)); } -void CefBrowserImpl::ViewSource(CefRefPtr frame) -{ +void CefBrowserImpl::ViewSource(CefRefPtr frame) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_HandleAction, MENU_ID_VIEWSOURCE, frame)); } -CefString CefBrowserImpl::GetSource(CefRefPtr frame) -{ +CefString CefBrowserImpl::GetSource(CefRefPtr frame) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return CefString(); } - + // Retrieve the document string directly WebKit::WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) + if (web_frame) return string16(web_frame->contentAsMarkup()); return CefString(); } -CefString CefBrowserImpl::GetText(CefRefPtr frame) -{ +CefString CefBrowserImpl::GetText(CefRefPtr frame) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; return CefString(); } - + // Retrieve the document text directly WebKit::WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) + if (web_frame) return webkit_glue::DumpDocumentText(web_frame); return CefString(); } void CefBrowserImpl::LoadRequest(CefRefPtr frame, - CefRefPtr request) -{ + CefRefPtr request) { DCHECK(request.get() != NULL); CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_LoadURLForRequestRef, frame, request)); } void CefBrowserImpl::LoadURL(CefRefPtr frame, - const CefString& url) -{ + const CefString& url) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_LoadURL, frame, url)); } void CefBrowserImpl::LoadString(CefRefPtr frame, const CefString& string, - const CefString& url) -{ + const CefString& url) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_LoadHTML, frame, string, url)); } void CefBrowserImpl::LoadStream(CefRefPtr frame, CefRefPtr stream, - const CefString& url) -{ + const CefString& url) { DCHECK(stream.get() != NULL); CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_LoadHTMLForStreamRef, frame, stream, url)); } void CefBrowserImpl::ExecuteJavaScript(CefRefPtr frame, - const CefString& jsCode, + const CefString& jsCode, const CefString& scriptUrl, - int startLine) -{ + int startLine) { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefBrowserImpl::UIT_ExecuteJavaScript, frame, jsCode, scriptUrl, startLine)); } -long long CefBrowserImpl::GetIdentifier(CefRefPtr frame) -{ +int64 CefBrowserImpl::GetIdentifier(CefRefPtr frame) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; @@ -618,13 +568,12 @@ long long CefBrowserImpl::GetIdentifier(CefRefPtr frame) } WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) + if (web_frame) return web_frame->identifier(); return 0; } -CefRefPtr CefBrowserImpl::GetParent(CefRefPtr frame) -{ +CefRefPtr CefBrowserImpl::GetParent(CefRefPtr frame) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; @@ -632,7 +581,7 @@ CefRefPtr CefBrowserImpl::GetParent(CefRefPtr frame) } WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) { + if (web_frame) { if (web_frame->parent() == NULL) { // This is the main frame. return NULL; @@ -642,8 +591,7 @@ CefRefPtr CefBrowserImpl::GetParent(CefRefPtr frame) return NULL; } -CefString CefBrowserImpl::GetURL(CefRefPtr frame) -{ +CefString CefBrowserImpl::GetURL(CefRefPtr frame) { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; @@ -651,25 +599,24 @@ CefString CefBrowserImpl::GetURL(CefRefPtr frame) } WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) + if (web_frame) return std::string(web_frame->document().url().spec()); return CefString(); } -CefRefPtr CefBrowserImpl::GetCefFrame(const CefString& name) -{ +CefRefPtr CefBrowserImpl::GetCefFrame(const CefString& name) { CefRefPtr cef_frame; - if(name.empty()) { + if (name.empty()) { // Use the single main frame reference. cef_frame = GetMainCefFrame(); } else { // Locate or create the appropriate named reference. AutoLock lock_scope(this); FrameMap::const_iterator it = frames_.find(name); - if(it != frames_.end()) + if (it != frames_.end()) { cef_frame = it->second; - else { + } else { cef_frame = new CefFrameImpl(this, name); frames_.insert(std::make_pair(name, cef_frame.get())); } @@ -678,36 +625,33 @@ CefRefPtr CefBrowserImpl::GetCefFrame(const CefString& name) return cef_frame; } -void CefBrowserImpl::RemoveCefFrame(const CefString& name) -{ +void CefBrowserImpl::RemoveCefFrame(const CefString& name) { AutoLock lock_scope(this); - if(name.empty()) { + if (name.empty()) { // Clear the single main frame reference. main_frame_ = NULL; } else { // Remove the appropriate named reference. FrameMap::iterator it = frames_.find(name); - if(it != frames_.end()) + if (it != frames_.end()) frames_.erase(it); } } -CefRefPtr CefBrowserImpl::GetMainCefFrame() -{ +CefRefPtr CefBrowserImpl::GetMainCefFrame() { // Return the single main frame reference. AutoLock lock_scope(this); - if(main_frame_ == NULL) + if (main_frame_ == NULL) main_frame_ = new CefFrameImpl(this, CefString()); return main_frame_; } -CefRefPtr CefBrowserImpl::UIT_GetCefFrame(WebFrame* frame) -{ +CefRefPtr CefBrowserImpl::UIT_GetCefFrame(WebFrame* frame) { REQUIRE_UIT(); CefRefPtr cef_frame; - if(frame->parent() == 0) { + if (frame->parent() == 0) { // Use the single main frame reference. cef_frame = GetMainCefFrame(); } else { @@ -720,8 +664,7 @@ CefRefPtr CefBrowserImpl::UIT_GetCefFrame(WebFrame* frame) return cef_frame; } -WebFrame* CefBrowserImpl::UIT_GetMainWebFrame() -{ +WebFrame* CefBrowserImpl::UIT_GetMainWebFrame() { REQUIRE_UIT(); WebView* view = UIT_GetWebView(); @@ -730,8 +673,7 @@ WebFrame* CefBrowserImpl::UIT_GetMainWebFrame() return NULL; } -WebFrame* CefBrowserImpl::UIT_GetWebFrame(CefRefPtr frame) -{ +WebFrame* CefBrowserImpl::UIT_GetWebFrame(CefRefPtr frame) { REQUIRE_UIT(); WebView* view = UIT_GetWebView(); @@ -739,13 +681,12 @@ WebFrame* CefBrowserImpl::UIT_GetWebFrame(CefRefPtr frame) return NULL; CefString name = frame->GetName(); - if(name.empty()) + if (name.empty()) return view ->mainFrame(); return view ->findFrameByName(string16(name)); } -void CefBrowserImpl::UIT_DestroyBrowser() -{ +void CefBrowserImpl::UIT_DestroyBrowser() { if (client_.get()) { CefRefPtr handler = client_->GetLifeSpanHandler(); if (handler.get()) { @@ -769,14 +710,14 @@ void CefBrowserImpl::UIT_DestroyBrowser() // If the current browser window is a dev tools client then disconnect from // the agent and destroy the client before destroying the window. UIT_DestroyDevToolsClient(); - + if (dev_tools_agent_.get()) { BrowserDevToolsClient* client = dev_tools_agent_->client(); if (client) { CefBrowserImpl* browser = client->browser(); // Destroy the client before freeing the agent. browser->UIT_DestroyDevToolsClient(); - if(!_Context->shutting_down()) { + if (!_Context->shutting_down()) { // Explicitly close the client browser window. browser->UIT_CloseBrowser(); } @@ -797,13 +738,12 @@ void CefBrowserImpl::UIT_DestroyBrowser() // Remove the reference added in UIT_CreateBrowser(). Release(); - + // Remove the browser from the list maintained by the context. _Context->RemoveBrowser(this); } -void CefBrowserImpl::UIT_CloseBrowser() -{ +void CefBrowserImpl::UIT_CloseBrowser() { REQUIRE_UIT(); if (IsWindowRenderingDisabled()) { UIT_DestroyBrowser(); @@ -815,23 +755,21 @@ void CefBrowserImpl::UIT_CloseBrowser() } void CefBrowserImpl::UIT_LoadURL(CefRefPtr frame, - const CefString& url) -{ + const CefString& url) { UIT_LoadURLForRequest(frame, url, CefString(), WebHTTPBody(), CefRequest::HeaderMap()); } void CefBrowserImpl::UIT_LoadURLForRequestRef(CefRefPtr frame, - CefRefPtr request) -{ + CefRefPtr request) { CefString url = request->GetURL(); CefString method = request->GetMethod(); - CefRequestImpl *impl = static_cast(request.get()); + CefRequestImpl* impl = static_cast(request.get()); WebHTTPBody upload_data; CefRefPtr postdata = impl->GetPostData(); - if(postdata.get()) { + if (postdata.get()) { upload_data.initialize(); static_cast(postdata.get())->Get(upload_data); } @@ -846,10 +784,9 @@ void CefBrowserImpl::UIT_LoadURLForRequest(CefRefPtr frame, const CefString& url, const CefString& method, const WebKit::WebHTTPBody& upload_data, - const CefRequest::HeaderMap& headers) -{ + const CefRequest::HeaderMap& headers) { REQUIRE_UIT(); - + if (url.empty()) return; @@ -871,8 +808,7 @@ void CefBrowserImpl::UIT_LoadURLForRequest(CefRefPtr frame, void CefBrowserImpl::UIT_LoadHTML(CefRefPtr frame, const CefString& html, - const CefString& url) -{ + const CefString& url) { REQUIRE_UIT(); std::string urlStr(url); @@ -887,16 +823,15 @@ void CefBrowserImpl::UIT_LoadHTML(CefRefPtr frame, } WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) + if (web_frame) web_frame->loadHTMLString(std::string(html), gurl); } void CefBrowserImpl::UIT_LoadHTMLForStreamRef(CefRefPtr frame, CefRefPtr stream, - const CefString& url) -{ + const CefString& url) { REQUIRE_UIT(); - + std::string urlStr(url); GURL gurl = GURL(urlStr); @@ -914,48 +849,44 @@ void CefBrowserImpl::UIT_LoadHTMLForStreamRef(CefRefPtr frame, size_t read; do { read = stream->Read(buff, sizeof(char), BUFFER_SIZE-1); - if(read > 0) { + if (read > 0) { buff[read] = 0; ss << buff; } } - while(read > 0); + while (read > 0); WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) + if (web_frame) web_frame->loadHTMLString(ss.str(), gurl); } void CefBrowserImpl::UIT_ExecuteJavaScript(CefRefPtr frame, - const CefString& js_code, + const CefString& js_code, const CefString& script_url, - int start_line) -{ + int start_line) { REQUIRE_UIT(); WebFrame* web_frame = UIT_GetWebFrame(frame); - if(web_frame) { + if (web_frame) { web_frame->executeScript(WebScriptSource(string16(js_code), WebURL(GURL(std::string(script_url))), start_line)); } } -void CefBrowserImpl::UIT_GoBackOrForward(int offset) -{ +void CefBrowserImpl::UIT_GoBackOrForward(int offset) { REQUIRE_UIT(); nav_controller_->GoToOffset(offset); } -void CefBrowserImpl::UIT_Reload(bool ignoreCache) -{ +void CefBrowserImpl::UIT_Reload(bool ignoreCache) { REQUIRE_UIT(); nav_controller_->Reload(ignoreCache); } bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry, bool reload, - bool ignoreCache) -{ + bool ignoreCache) { REQUIRE_UIT(); WebView* view = UIT_GetWebView(); @@ -985,26 +916,25 @@ bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry, if (reload) { frame->reload(ignoreCache); } else if (!entry.GetContentState().empty()) { - DCHECK(entry.GetPageID() != -1); + DCHECK_NE(entry.GetPageID(), -1); frame->loadHistoryItem( webkit_glue::HistoryItemFromString(entry.GetContentState())); } else { - DCHECK(entry.GetPageID() == -1); + DCHECK_EQ(entry.GetPageID(), -1); WebURLRequest request(entry.GetURL()); - if(entry.GetMethod().length() > 0) + if (entry.GetMethod().length() > 0) request.setHTTPMethod(string16(entry.GetMethod())); - if(entry.GetHeaders().size() > 0) + if (entry.GetHeaders().size() > 0) CefRequestImpl::SetHeaderMap(entry.GetHeaders(), request); - if(!entry.GetUploadData().isNull()) - { + if (!entry.GetUploadData().isNull()) { string16 method = request.httpMethod(); - if(method == ASCIIToUTF16("GET") || method == ASCIIToUTF16("HEAD")) + if (method == ASCIIToUTF16("GET") || method == ASCIIToUTF16("HEAD")) request.setHTTPMethod(ASCIIToUTF16("POST")); - if(request.httpHeaderField(ASCIIToUTF16("Content-Type")).length() == 0) { + if (request.httpHeaderField(ASCIIToUTF16("Content-Type")).length() == 0) { request.setHTTPHeaderField( ASCIIToUTF16("Content-Type"), ASCIIToUTF16("application/x-www-form-urlencoded")); @@ -1045,20 +975,18 @@ bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry, } -void CefBrowserImpl::UIT_SetSize(PaintElementType type, int width, int height) -{ - if(type == PET_VIEW) { +void CefBrowserImpl::UIT_SetSize(PaintElementType type, int width, int height) { + if (type == PET_VIEW) { WebViewHost* host = UIT_GetWebViewHost(); if (host) host->SetSize(width, height); - } else if(type == PET_POPUP) { + } else if (type == PET_POPUP) { if (popuphost_) popuphost_->SetSize(width, height); } } -void CefBrowserImpl::UIT_Invalidate(const CefRect& dirtyRect) -{ +void CefBrowserImpl::UIT_Invalidate(const CefRect& dirtyRect) { REQUIRE_UIT(); WebViewHost* host = UIT_GetWebViewHost(); if (host) { @@ -1075,8 +1003,7 @@ void CefBrowserImpl::UIT_Invalidate(const CefRect& dirtyRect) } void CefBrowserImpl::UIT_SendKeyEvent(KeyType type, int key, int modifiers, - bool sysChar, bool imeChar) -{ + bool sysChar, bool imeChar) { REQUIRE_UIT(); if (popuphost_) { // Send the event to the popup. @@ -1089,8 +1016,7 @@ void CefBrowserImpl::UIT_SendKeyEvent(KeyType type, int key, int modifiers, } void CefBrowserImpl::UIT_SendMouseClickEvent(int x, int y, MouseButtonType type, - bool mouseUp, int clickCount) -{ + bool mouseUp, int clickCount) { REQUIRE_UIT(); if (popuphost_ && popup_rect_.Contains(x, y)) { // Send the event to the popup. @@ -1103,8 +1029,7 @@ void CefBrowserImpl::UIT_SendMouseClickEvent(int x, int y, MouseButtonType type, } } -void CefBrowserImpl::UIT_SendMouseMoveEvent(int x, int y, bool mouseLeave) -{ +void CefBrowserImpl::UIT_SendMouseMoveEvent(int x, int y, bool mouseLeave) { REQUIRE_UIT(); if (popuphost_ && popup_rect_.Contains(x, y)) { // Send the event to the popup. @@ -1117,8 +1042,7 @@ void CefBrowserImpl::UIT_SendMouseMoveEvent(int x, int y, bool mouseLeave) } } -void CefBrowserImpl::UIT_SendMouseWheelEvent(int x, int y, int delta) -{ +void CefBrowserImpl::UIT_SendMouseWheelEvent(int x, int y, int delta) { REQUIRE_UIT(); if (popuphost_ && popup_rect_.Contains(x, y)) { // Send the event to the popup. @@ -1131,16 +1055,14 @@ void CefBrowserImpl::UIT_SendMouseWheelEvent(int x, int y, int delta) } } -void CefBrowserImpl::UIT_SendFocusEvent(bool setFocus) -{ +void CefBrowserImpl::UIT_SendFocusEvent(bool setFocus) { REQUIRE_UIT(); WebViewHost* host = UIT_GetWebViewHost(); if (host) host->SendFocusEvent(setFocus); } -void CefBrowserImpl::UIT_SendCaptureLostEvent() -{ +void CefBrowserImpl::UIT_SendCaptureLostEvent() { REQUIRE_UIT(); WebViewHost* host = UIT_GetWebViewHost(); if (host) @@ -1148,10 +1070,9 @@ void CefBrowserImpl::UIT_SendCaptureLostEvent() } CefRefPtr CefBrowserImpl::UIT_CreatePopupWindow( - const CefString& url, const CefPopupFeatures& features) -{ + const CefString& url, const CefPopupFeatures& features) { REQUIRE_UIT(); - + CefWindowInfo info; #if defined(OS_WIN) info.SetAsPopup(NULL, CefString()); @@ -1159,13 +1080,13 @@ CefRefPtr CefBrowserImpl::UIT_CreatePopupWindow( #if (defined(OS_WIN) || defined(OS_MACOSX)) // Default to the size from the popup features. - if(features.xSet) + if (features.xSet) info.m_x = features.x; - if(features.ySet) + if (features.ySet) info.m_y = features.y; - if(features.widthSet) + if (features.widthSet) info.m_nWidth = features.width; - if(features.heightSet) + if (features.heightSet) info.m_nHeight = features.height; #endif @@ -1185,7 +1106,7 @@ CefRefPtr CefBrowserImpl::UIT_CreatePopupWindow( } // Modal windows need to know which window is being suspended (the opener) - // so that it can be disabled while the modal window is open. + // so that it can be disabled while the modal window is open. CefRefPtr browser( new CefBrowserImpl(info, settings, UIT_GetMainWndHandle(), client)); @@ -1197,8 +1118,7 @@ CefRefPtr CefBrowserImpl::UIT_CreatePopupWindow( return browser; } -WebKit::WebWidget* CefBrowserImpl::UIT_CreatePopupWidget() -{ +WebKit::WebWidget* CefBrowserImpl::UIT_CreatePopupWidget() { REQUIRE_UIT(); DCHECK(!popuphost_); @@ -1210,13 +1130,12 @@ WebKit::WebWidget* CefBrowserImpl::UIT_CreatePopupWidget() return popuphost_->webwidget(); } -void CefBrowserImpl::UIT_ClosePopupWidget() -{ +void CefBrowserImpl::UIT_ClosePopupWidget() { REQUIRE_UIT(); if (!popuphost_) return; - + #if !defined(OS_MACOSX) // Mac uses a WebPopupMenu for select lists so no closing is necessary. if (!IsWindowRenderingDisabled()) @@ -1234,86 +1153,81 @@ void CefBrowserImpl::UIT_ClosePopupWidget() } } -void CefBrowserImpl::UIT_Show(WebKit::WebNavigationPolicy policy) -{ +void CefBrowserImpl::UIT_Show(WebKit::WebNavigationPolicy policy) { REQUIRE_UIT(); delegate_->show(policy); } -void CefBrowserImpl::UIT_HandleActionView(cef_menu_id_t menuId) -{ +void CefBrowserImpl::UIT_HandleActionView(cef_menu_id_t menuId) { return UIT_HandleAction(menuId, NULL); } void CefBrowserImpl::UIT_HandleAction(cef_menu_id_t menuId, - CefRefPtr frame) -{ + CefRefPtr frame) { REQUIRE_UIT(); WebFrame* web_frame = NULL; - if(frame) + if (frame) web_frame = UIT_GetWebFrame(frame); - switch(menuId) - { - case MENU_ID_NAV_BACK: - UIT_GoBackOrForward(-1); - break; - case MENU_ID_NAV_FORWARD: - UIT_GoBackOrForward(1); - break; - case MENU_ID_NAV_RELOAD: - UIT_Reload(false); - break; - case MENU_ID_NAV_RELOAD_NOCACHE: - UIT_Reload(true); - break; - case MENU_ID_NAV_STOP: - if (UIT_GetWebView()) - UIT_GetWebView()->mainFrame()->stopLoading(); - break; - case MENU_ID_UNDO: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("Undo")); - break; - case MENU_ID_REDO: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("Redo")); - break; - case MENU_ID_CUT: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("Cut")); - break; - case MENU_ID_COPY: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("Copy")); - break; - case MENU_ID_PASTE: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("Paste")); - break; - case MENU_ID_DELETE: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("Delete")); - break; - case MENU_ID_SELECTALL: - if(web_frame) - web_frame->executeCommand(WebString::fromUTF8("SelectAll")); - break; - case MENU_ID_PRINT: - if(web_frame) - UIT_PrintPages(web_frame); - break; - case MENU_ID_VIEWSOURCE: - if(web_frame) - UIT_ViewDocumentString(web_frame); - break; + switch (menuId) { + case MENU_ID_NAV_BACK: + UIT_GoBackOrForward(-1); + break; + case MENU_ID_NAV_FORWARD: + UIT_GoBackOrForward(1); + break; + case MENU_ID_NAV_RELOAD: + UIT_Reload(false); + break; + case MENU_ID_NAV_RELOAD_NOCACHE: + UIT_Reload(true); + break; + case MENU_ID_NAV_STOP: + if (UIT_GetWebView()) + UIT_GetWebView()->mainFrame()->stopLoading(); + break; + case MENU_ID_UNDO: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("Undo")); + break; + case MENU_ID_REDO: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("Redo")); + break; + case MENU_ID_CUT: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("Cut")); + break; + case MENU_ID_COPY: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("Copy")); + break; + case MENU_ID_PASTE: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("Paste")); + break; + case MENU_ID_DELETE: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("Delete")); + break; + case MENU_ID_SELECTALL: + if (web_frame) + web_frame->executeCommand(WebString::fromUTF8("SelectAll")); + break; + case MENU_ID_PRINT: + if (web_frame) + UIT_PrintPages(web_frame); + break; + case MENU_ID_VIEWSOURCE: + if (web_frame) + UIT_ViewDocumentString(web_frame); + break; } } void CefBrowserImpl::UIT_Find(int identifier, const CefString& search_text, - const WebKit::WebFindOptions& options) -{ + const WebKit::WebFindOptions& options) { WebView* view = UIT_GetWebView(); if (!view) return; @@ -1435,8 +1349,7 @@ void CefBrowserImpl::UIT_Find(int identifier, const CefString& search_text, } } -void CefBrowserImpl::UIT_StopFinding(bool clear_selection) -{ +void CefBrowserImpl::UIT_StopFinding(bool clear_selection) { WebView* view = UIT_GetWebView(); if (!view) return; @@ -1463,9 +1376,8 @@ void CefBrowserImpl::UIT_StopFinding(bool clear_selection) void CefBrowserImpl::UIT_NotifyFindStatus(int identifier, int count, const WebKit::WebRect& selection_rect, int active_match_ordinal, - bool final_update) -{ - if(client_.get()) { + bool final_update) { + if (client_.get()) { CefRefPtr handler = client_->GetFindHandler(); if (handler.get()) { CefRect rect(selection_rect.x, selection_rect.y, selection_rect.width, @@ -1476,22 +1388,20 @@ void CefBrowserImpl::UIT_NotifyFindStatus(int identifier, int count, } } -void CefBrowserImpl::UIT_SetZoomLevel(double zoomLevel) -{ +void CefBrowserImpl::UIT_SetZoomLevel(double zoomLevel) { REQUIRE_UIT(); WebKit::WebFrame* web_frame = UIT_GetMainWebFrame(); - if(web_frame) { + if (web_frame) { web_frame->view()->setZoomLevel(false, zoomLevel); ZoomMap::GetInstance()->set(web_frame->document().url(), zoomLevel); set_zoom_level(zoomLevel); } } -void CefBrowserImpl::UIT_ShowDevTools() -{ +void CefBrowserImpl::UIT_ShowDevTools() { REQUIRE_UIT(); - if(!dev_tools_agent_.get()) + if (!dev_tools_agent_.get()) return; BrowserDevToolsClient* client = dev_tools_agent_->client(); @@ -1515,11 +1425,10 @@ void CefBrowserImpl::UIT_ShowDevTools() } } -void CefBrowserImpl::UIT_CloseDevTools() -{ +void CefBrowserImpl::UIT_CloseDevTools() { REQUIRE_UIT(); - if(!dev_tools_agent_.get()) + if (!dev_tools_agent_.get()) return; BrowserDevToolsClient* client = dev_tools_agent_->client(); @@ -1528,8 +1437,7 @@ void CefBrowserImpl::UIT_CloseDevTools() } void CefBrowserImpl::UIT_VisitDOM(CefRefPtr frame, - CefRefPtr visitor) -{ + CefRefPtr visitor) { REQUIRE_UIT(); WebKit::WebFrame* web_frame = UIT_GetWebFrame(frame); @@ -1550,8 +1458,7 @@ void CefBrowserImpl::UIT_VisitDOM(CefRefPtr frame, } void CefBrowserImpl::UIT_AddFrameObject(WebKit::WebFrame* frame, - CefTrackObject* tracked_object) -{ + CefTrackObject* tracked_object) { REQUIRE_UIT(); CefRefPtr manager; @@ -1570,8 +1477,7 @@ void CefBrowserImpl::UIT_AddFrameObject(WebKit::WebFrame* frame, manager->Add(tracked_object); } -void CefBrowserImpl::UIT_BeforeFrameClosed(WebKit::WebFrame* frame) -{ +void CefBrowserImpl::UIT_BeforeFrameClosed(WebKit::WebFrame* frame) { REQUIRE_UIT(); if (!frame_objects_.empty()) { @@ -1582,56 +1488,47 @@ void CefBrowserImpl::UIT_BeforeFrameClosed(WebKit::WebFrame* frame) } } -void CefBrowserImpl::set_zoom_level(double zoomLevel) -{ +void CefBrowserImpl::set_zoom_level(double zoomLevel) { AutoLock lock_scope(this); zoom_level_ = zoomLevel; } -double CefBrowserImpl::zoom_level() -{ +double CefBrowserImpl::zoom_level() { AutoLock lock_scope(this); return zoom_level_; } -void CefBrowserImpl::set_nav_state(bool can_go_back, bool can_go_forward) -{ +void CefBrowserImpl::set_nav_state(bool can_go_back, bool can_go_forward) { AutoLock lock_scope(this); can_go_back_ = can_go_back; can_go_forward_ = can_go_forward; } -bool CefBrowserImpl::can_go_back() -{ +bool CefBrowserImpl::can_go_back() { AutoLock lock_scope(this); return can_go_back_; } -bool CefBrowserImpl::can_go_forward() -{ +bool CefBrowserImpl::can_go_forward() { AutoLock lock_scope(this); return can_go_forward_; } -void CefBrowserImpl::set_has_document(bool has_document) -{ +void CefBrowserImpl::set_has_document(bool has_document) { AutoLock lock_scope(this); has_document_ = has_document; } -bool CefBrowserImpl::has_document() -{ +bool CefBrowserImpl::has_document() { AutoLock lock_scope(this); return has_document_; } -void CefBrowserImpl::UIT_CreateDevToolsClient(BrowserDevToolsAgent *agent) -{ +void CefBrowserImpl::UIT_CreateDevToolsClient(BrowserDevToolsAgent *agent) { dev_tools_client_.reset(new BrowserDevToolsClient(this, agent)); } -void CefBrowserImpl::UIT_DestroyDevToolsClient() -{ +void CefBrowserImpl::UIT_DestroyDevToolsClient() { if (dev_tools_client_.get()) { // Free the client. This will cause the client to clear pending messages // and detach from the agent. @@ -1643,17 +1540,14 @@ void CefBrowserImpl::UIT_DestroyDevToolsClient() // CefFrameImpl CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, const CefString& name) - : browser_(browser), name_(name) -{ + : browser_(browser), name_(name) { } -CefFrameImpl::~CefFrameImpl() -{ +CefFrameImpl::~CefFrameImpl() { browser_->RemoveCefFrame(name_); } -bool CefFrameImpl::IsFocused() -{ +bool CefFrameImpl::IsFocused() { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; @@ -1665,9 +1559,8 @@ bool CefFrameImpl::IsFocused() browser_->UIT_GetWebView()->focusedFrame())); } -void CefFrameImpl::VisitDOM(CefRefPtr visitor) -{ - if(!visitor.get()) { +void CefFrameImpl::VisitDOM(CefRefPtr visitor) { + if (!visitor.get()) { NOTREACHED() << "invalid parameter"; return; } @@ -1676,8 +1569,7 @@ void CefFrameImpl::VisitDOM(CefRefPtr visitor) browser_.get(), &CefBrowserImpl::UIT_VisitDOM, framePtr, visitor)); } -CefRefPtr CefFrameImpl::GetV8Context() -{ +CefRefPtr CefFrameImpl::GetV8Context() { // Verify that this method is being called on the UI thread. if (!CefThread::CurrentlyOn(CefThread::UI)) { NOTREACHED() << "called on invalid thread"; diff --git a/libcef/browser_impl.h b/libcef/browser_impl.h index b420b7b3f..530b62794 100644 --- a/libcef/browser_impl.h +++ b/libcef/browser_impl.h @@ -3,22 +3,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_IMPL_H -#define _BROWSER_IMPL_H +#ifndef CEF_LIBCEF_BROWSER_IMPL_H_ +#define CEF_LIBCEF_BROWSER_IMPL_H_ +#pragma once + +#include +#include +#include #include "include/cef_browser.h" #include "include/cef_client.h" #include "include/cef_frame.h" -#include "webview_host.h" -#include "browser_devtools_agent.h" -#include "browser_devtools_client.h" -#include "browser_webview_delegate.h" -#include "browser_navigation_controller.h" -#include "cef_thread.h" -#include "tracker.h" +#include "libcef/webview_host.h" +#include "libcef/browser_devtools_agent.h" +#include "libcef/browser_devtools_client.h" +#include "libcef/browser_webview_delegate.h" +#include "libcef/browser_navigation_controller.h" +#include "libcef/cef_thread.h" +#include "libcef/tracker.h" #if defined(OS_WIN) -#include "printing/win_printing_context.h" +#include "libcef/printing/win_printing_context.h" #endif #include "base/scoped_temp_dir.h" @@ -35,19 +40,17 @@ class WebView; // Implementation of CefBrowser. -class CefBrowserImpl : public CefBrowser -{ -public: - class PaintDelegate : public WebWidgetHost::PaintDelegate - { - public: - PaintDelegate(CefBrowserImpl* browser); +class CefBrowserImpl : public CefBrowser { + public: + class PaintDelegate : public WebWidgetHost::PaintDelegate { + public: + explicit PaintDelegate(CefBrowserImpl* browser); virtual ~PaintDelegate(); virtual void Paint(bool popup, const std::vector& dirtyRects, const void* buffer) OVERRIDE; - protected: + protected: CefBrowserImpl* browser_; }; @@ -133,10 +136,10 @@ public: CefRefPtr stream, const CefString& url); void ExecuteJavaScript(CefRefPtr frame, - const CefString& jsCode, + const CefString& jsCode, const CefString& scriptUrl, int startLine); - long long GetIdentifier(CefRefPtr frame); + int64 GetIdentifier(CefRefPtr frame); CefRefPtr GetParent(CefRefPtr frame); CefString GetURL(CefRefPtr frame); @@ -154,7 +157,7 @@ public: //////////////////////////////////////////////////////////// CefRefPtr UIT_GetCefFrame(WebKit::WebFrame* frame); - + // Return the main WebFrame object. WebKit::WebFrame* UIT_GetMainWebFrame(); @@ -203,7 +206,7 @@ public: REQUIRE_UIT(); return nav_controller_.get(); } - + // Return true to allow user editing such as entering text in form elements bool UIT_AllowEditing() { return true; } @@ -252,7 +255,7 @@ public: CefRefPtr stream, const CefString& url); void UIT_ExecuteJavaScript(CefRefPtr frame, - const CefString& js_code, + const CefString& js_code, const CefString& script_url, int start_line); void UIT_GoBackOrForward(int offset); @@ -278,7 +281,7 @@ public: void UIT_ClosePopupWidget(); void UIT_Show(WebKit::WebNavigationPolicy policy); - + // Handles most simple browser actions void UIT_HandleActionView(cef_menu_id_t menuId); void UIT_HandleAction(cef_menu_id_t menuId, CefRefPtr frame); @@ -322,7 +325,7 @@ public: const FilePath& file_system_root() const { return file_system_root_.path(); } gfx::NativeView opener_window() { return opener_; } bool is_popup() { return (opener_ != NULL); } - + // These variables may be read/written from multiple threads. void set_zoom_level(double zoomLevel); double zoom_level(); @@ -336,12 +339,10 @@ public: bool is_dropping() { return is_dropping_; } #if defined(OS_WIN) - void set_opener_was_disabled_by_modal_loop(bool disabled) - { + void set_opener_was_disabled_by_modal_loop(bool disabled) { opener_was_disabled_by_modal_loop_ = disabled; } - void set_internal_modal_message_loop_is_active(bool active) - { + void set_internal_modal_message_loop_is_active(bool active) { internal_modal_message_loop_is_active_ = active; } #endif @@ -350,14 +351,13 @@ public: static bool ImplementsThreadSafeReferenceCounting() { return true; } -protected: + protected: static void UIT_CloseView(gfx::NativeView view); static bool UIT_IsViewVisible(gfx::NativeView view); void UIT_CreateDevToolsClient(BrowserDevToolsAgent* agent); void UIT_DestroyDevToolsClient(); -protected: CefWindowInfo window_info_; CefBrowserSettings settings_; // Handle of the browser window that opened this window. @@ -404,7 +404,7 @@ protected: // Unique browser ID assigned by the context. int unique_id_; - + // A temporary directory for FileSystem API. ScopedTempDir file_system_root_; @@ -414,9 +414,8 @@ protected: // Implementation of CefFrame. -class CefFrameImpl : public CefFrame -{ -public: +class CefFrameImpl : public CefFrame { + public: CefFrameImpl(CefBrowserImpl* browser, const CefString& name); virtual ~CefFrameImpl(); @@ -432,37 +431,44 @@ public: virtual void ViewSource() OVERRIDE { browser_->ViewSource(this); } virtual CefString GetSource() OVERRIDE { return browser_->GetSource(this); } virtual CefString GetText() OVERRIDE { return browser_->GetText(this); } - virtual void LoadRequest(CefRefPtr request) OVERRIDE - { return browser_->LoadRequest(this, request); } - virtual void LoadURL(const CefString& url) OVERRIDE - { return browser_->LoadURL(this, url); } + virtual void LoadRequest(CefRefPtr request) OVERRIDE { + return browser_->LoadRequest(this, request); + } + virtual void LoadURL(const CefString& url) OVERRIDE { + return browser_->LoadURL(this, url); + } virtual void LoadString(const CefString& string, - const CefString& url) OVERRIDE - { return browser_->LoadString(this, string, url); } + const CefString& url) OVERRIDE { + return browser_->LoadString(this, string, url); + } virtual void LoadStream(CefRefPtr stream, - const CefString& url) OVERRIDE - { return browser_->LoadStream(this, stream, url); } - virtual void ExecuteJavaScript(const CefString& jsCode, + const CefString& url) OVERRIDE { + return browser_->LoadStream(this, stream, url); + } + virtual void ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl, - int startLine) OVERRIDE - { return browser_->ExecuteJavaScript(this, jsCode, scriptUrl, startLine); } + int startLine) OVERRIDE { + return browser_->ExecuteJavaScript(this, jsCode, scriptUrl, startLine); + } virtual bool IsMain() OVERRIDE { return name_.empty(); } virtual bool IsFocused() OVERRIDE; virtual CefString GetName() OVERRIDE { return name_; } - virtual long long GetIdentifier() OVERRIDE - { return browser_->GetIdentifier(this); } - virtual CefRefPtr GetParent() OVERRIDE - { return browser_->GetParent(this); } + virtual int64 GetIdentifier() OVERRIDE { + return browser_->GetIdentifier(this); + } + virtual CefRefPtr GetParent() OVERRIDE { + return browser_->GetParent(this); + } virtual CefString GetURL() OVERRIDE { return browser_->GetURL(this); } virtual CefRefPtr GetBrowser() OVERRIDE { return browser_.get(); } virtual void VisitDOM(CefRefPtr visitor) OVERRIDE; virtual CefRefPtr GetV8Context() OVERRIDE; -private: + private: CefRefPtr browser_; CefString name_; IMPLEMENT_REFCOUNTING(CefFrameImpl); }; -#endif // _BROWSER_IMPL_H +#endif // CEF_LIBCEF_BROWSER_IMPL_H_ diff --git a/libcef/browser_impl_gtk.cc b/libcef/browser_impl_gtk.cc index 5180f720e..c8dc867d1 100644 --- a/libcef/browser_impl_gtk.cc +++ b/libcef/browser_impl_gtk.cc @@ -3,12 +3,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_context.h" -#include "browser_impl.h" -#include "browser_settings.h" - #include +#include "libcef/cef_context.h" +#include "libcef/browser_impl.h" +#include "libcef/browser_settings.h" + #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" @@ -24,21 +24,18 @@ void window_destroyed(GtkWidget* widget, CefBrowserImpl* browser) { browser->UIT_DestroyBrowser(); } -} // namespace +} // namespace -void CefBrowserImpl::ParentWindowWillClose() -{ +void CefBrowserImpl::ParentWindowWillClose() { // TODO(port): Implement this method if necessary. } -CefWindowHandle CefBrowserImpl::GetWindowHandle() -{ +CefWindowHandle CefBrowserImpl::GetWindowHandle() { AutoLock lock_scope(this); return window_info_.m_Widget; } -bool CefBrowserImpl::IsWindowRenderingDisabled() -{ +bool CefBrowserImpl::IsWindowRenderingDisabled() { // TODO(port): Add support for off-screen rendering. return false; } @@ -53,8 +50,7 @@ void CefBrowserImpl::UIT_ClearMainWndHandle() { window_info_.m_Widget = NULL; } -bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) -{ +bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) { REQUIRE_UIT(); Lock(); @@ -67,10 +63,10 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) if (!settings_.developer_tools_disabled) dev_tools_agent_.reset(new BrowserDevToolsAgent()); - GtkWidget *window; + GtkWidget* window; GtkWidget* parentView = window_info_.m_ParentWidget; - if(parentView == NULL) { + if (parentView == NULL) { // Create a new window. window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(window), 800, 600); @@ -104,30 +100,28 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) if (client_.get()) { CefRefPtr handler = client_->GetLifeSpanHandler(); - if(handler.get()) { + if (handler.get()) { // Notify the handler that we're done creating the new window handler->OnAfterCreated(this); } } - if(url.size() > 0) + if (url.size() > 0) UIT_LoadURL(GetMainFrame(), url); return true; } -void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) -{ +void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) { REQUIRE_UIT(); if (!host) return; - if(enable) + if (enable) gtk_widget_grab_focus(host->view_handle()); } -bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) -{ +bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) { REQUIRE_UIT(); char buff[] = "/tmp/CEFSourceXXXXXX"; @@ -141,7 +135,7 @@ bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) if (!srcOutput) return false; - + std::string markup = frame->contentAsMarkup().utf8(); if (fputs(markup.c_str(), srcOutput) < 0) { fclose(srcOutput); @@ -179,8 +173,7 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { NOTIMPLEMENTED(); } -int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) -{ +int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) { REQUIRE_UIT(); // TODO(port): Add implementation. @@ -189,20 +182,18 @@ int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) } // static -void CefBrowserImpl::UIT_CloseView(gfx::NativeView view) -{ +void CefBrowserImpl::UIT_CloseView(gfx::NativeView view) { GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view)); gtk_widget_destroy(window); } // static -bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view) -{ +bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view) { if (!view) return false; - + if (view->window) - return (bool)gdk_window_is_visible(view->window); + return gdk_window_is_visible(view->window)?true:false; else return false; } diff --git a/libcef/browser_impl_mac.mm b/libcef/browser_impl_mac.mm index 86f2f33a8..04d24ac3c 100644 --- a/libcef/browser_impl_mac.mm +++ b/libcef/browser_impl_mac.mm @@ -3,13 +3,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_context.h" -#include "browser_impl.h" -#include "browser_settings.h" -#include "browser_webview_mac.h" - #import +#include "libcef/cef_context.h" +#include "libcef/browser_impl.h" +#include "libcef/browser_settings.h" +#include "libcef/browser_webview_mac.h" + #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" @@ -19,19 +19,16 @@ using WebKit::WebRect; using WebKit::WebSize; -void CefBrowserImpl::ParentWindowWillClose() -{ +void CefBrowserImpl::ParentWindowWillClose() { // TODO(port): Implement this method if necessary. } -CefWindowHandle CefBrowserImpl::GetWindowHandle() -{ +CefWindowHandle CefBrowserImpl::GetWindowHandle() { AutoLock lock_scope(this); return window_info_.m_View; } -bool CefBrowserImpl::IsWindowRenderingDisabled() -{ +bool CefBrowserImpl::IsWindowRenderingDisabled() { // TODO(port): Add support for off-screen rendering. return false; } @@ -46,8 +43,7 @@ void CefBrowserImpl::UIT_ClearMainWndHandle() { window_info_.m_View = NULL; } -bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) -{ +bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) { REQUIRE_UIT(); Lock(); @@ -129,8 +125,7 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) return true; } -void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) -{ +void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) { REQUIRE_UIT(); if (!host) return; @@ -143,8 +138,7 @@ void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) [[view window] makeFirstResponder:view]; } -bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) -{ +bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) { REQUIRE_UIT(); // TODO(port): Add implementation. @@ -168,8 +162,7 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { NOTIMPLEMENTED(); } -int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) -{ +int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) { REQUIRE_UIT(); // TODO(port): Add implementation. @@ -178,15 +171,13 @@ int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) } // static -void CefBrowserImpl::UIT_CloseView(gfx::NativeView view) -{ +void CefBrowserImpl::UIT_CloseView(gfx::NativeView view) { [[view window] performSelector:@selector(performClose:) withObject:nil afterDelay:0]; } // static -bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view) -{ +bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view) { return [[view window] isVisible]; } diff --git a/libcef/browser_impl_win.cc b/libcef/browser_impl_win.cc index ad3fc1f3b..e7c54d57d 100644 --- a/libcef/browser_impl_win.cc +++ b/libcef/browser_impl_win.cc @@ -3,12 +3,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_context.h" -#include "browser_impl.h" -#include "browser_settings.h" -#include "printing/units.h" +#include "libcef/browser_impl.h" + +#include +#include +#include +#include +#include + +#include "libcef/cef_context.h" +#include "libcef/browser_settings.h" #include "base/win/windows_version.h" +#include "printing/units.h" #include "skia/ext/vector_canvas.h" #include "skia/ext/vector_platform_device_emf_win.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" @@ -19,12 +26,6 @@ #include "ui/base/win/hwnd_util.h" #include "webkit/glue/webpreferences.h" -#include -#include -#include -#include -#include - #pragma comment(lib, "dwmapi.lib") using WebKit::WebRect; @@ -35,7 +36,7 @@ namespace { bool IsAeroGlassEnabled() { if (base::win::GetVersion() < base::win::VERSION_VISTA) return false; - + BOOL enabled = FALSE; return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; } @@ -49,22 +50,20 @@ void SetAeroGlass(HWND hWnd) { DwmExtendFrameIntoClientArea(hWnd, &mgMarInset); } -} // namespace +} // namespace -LPCTSTR CefBrowserImpl::GetWndClass() -{ +LPCTSTR CefBrowserImpl::GetWndClass() { return L"CefBrowserWindow"; } LRESULT CALLBACK CefBrowserImpl::WndProc(HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam) -{ + WPARAM wParam, LPARAM lParam) { CefBrowserImpl* browser = static_cast(ui::GetWindowUserData(hwnd)); switch (message) { case WM_CLOSE: - if(browser) { + if (browser) { bool handled(false); if (browser->client_.get()) { @@ -136,8 +135,7 @@ LRESULT CALLBACK CefBrowserImpl::WndProc(HWND hwnd, UINT message, return DefWindowProc(hwnd, message, wParam, lParam); } -void CefBrowserImpl::ParentWindowWillClose() -{ +void CefBrowserImpl::ParentWindowWillClose() { // We must re-enable the opener (owner of the modal window) before we close // the popup to avoid focus/activation/z-order issues. if (opener_ && opener_was_disabled_by_modal_loop_) { @@ -146,14 +144,12 @@ void CefBrowserImpl::ParentWindowWillClose() } } -CefWindowHandle CefBrowserImpl::GetWindowHandle() -{ +CefWindowHandle CefBrowserImpl::GetWindowHandle() { AutoLock lock_scope(this); return window_info_.m_hWnd; } -bool CefBrowserImpl::IsWindowRenderingDisabled() -{ +bool CefBrowserImpl::IsWindowRenderingDisabled() { return (window_info_.m_bWindowRenderingDisabled ? true : false); } @@ -169,8 +165,7 @@ void CefBrowserImpl::UIT_ClearMainWndHandle() { window_info_.m_hWnd = NULL; } -bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) -{ +bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) { REQUIRE_UIT(); Lock(); @@ -235,7 +230,7 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) if (!window_info_.m_bWindowRenderingDisabled) { if (!settings_.drag_drop_disabled) delegate_->RegisterDragDrop(); - + // Size the web view window to the browser window RECT cr; GetClientRect(window_info_.m_hWnd, &cr); @@ -251,7 +246,7 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) cr.bottom, flags); } - if(client_.get()) { + if (client_.get()) { CefRefPtr handler = client_->GetLifeSpanHandler(); if (handler.get()) { // Notify the handler that we're done creating the new window @@ -259,14 +254,13 @@ bool CefBrowserImpl::UIT_CreateBrowser(const CefString& url) } } - if(url.length() > 0) + if (url.length() > 0) UIT_LoadURL(GetMainFrame(), url); return true; } -void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) -{ +void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) { REQUIRE_UIT(); if (!host) return; @@ -278,8 +272,7 @@ void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) } static void WriteTextToFile(const std::string& data, - const std::wstring& file_path) -{ + const std::wstring& file_path) { FILE* fp; errno_t err = _wfopen_s(&fp, file_path.c_str(), L"wt"); if (err) @@ -288,37 +281,36 @@ static void WriteTextToFile(const std::string& data, fclose(fp); } -bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) -{ +bool CefBrowserImpl::UIT_ViewDocumentString(WebKit::WebFrame *frame) { REQUIRE_UIT(); - + DWORD dwRetVal; DWORD dwBufSize = 512; TCHAR lpPathBuffer[512]; UINT uRetVal; TCHAR szTempName[512]; - - dwRetVal = GetTempPath(dwBufSize, // length of the buffer - lpPathBuffer); // buffer for path + + dwRetVal = GetTempPath(dwBufSize, // length of the buffer + lpPathBuffer); // buffer for path if (dwRetVal > dwBufSize || (dwRetVal == 0)) return false; - // Create a temporary file. - uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files - TEXT("src"), // temp file name prefix - 0, // create unique name - szTempName); // buffer for name + // Create a temporary file. + uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files + TEXT("src"), // temp file name prefix + 0, // create unique name + szTempName); // buffer for name if (uRetVal == 0) return false; - + size_t len = wcslen(szTempName); wcscpy(szTempName + len - 3, L"txt"); std::string markup = frame->contentAsMarkup().utf8(); WriteTextToFile(markup, szTempName); - int errorCode = (int)ShellExecute(UIT_GetMainWndHandle(), L"open", szTempName, - NULL, NULL, SW_SHOWNORMAL); - if(errorCode <= 32) + int errorCode = reinterpret_cast(ShellExecute(UIT_GetMainWndHandle(), + L"open", szTempName, NULL, NULL, SW_SHOWNORMAL)); + if (errorCode <= 32) return false; return true; @@ -345,7 +337,7 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, HDC hDC = print_context_.context(); BOOL res; - + // Save the state to make sure the context this function call does not modify // the device context. int saved_state = SaveDC(hDC); @@ -367,9 +359,9 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, settings.page_setup_pixels().printable_area().y(); // Adjust for the margin offset. - canvas.translate(static_cast(left_margin_offset), + canvas.translate(static_cast(left_margin_offset), static_cast(top_margin_offset)); - + // Apply the print scaling factor. const float print_scale_x = static_cast(settings.page_setup_pixels().content_area().width()) @@ -385,7 +377,7 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, NOTREACHED() << "Printing page " << page_number << " failed."; } canvas.scale(webkit_scale, webkit_scale); - + frame->printPage(page_number, &canvas); res = RestoreDC(hDC, saved_state); @@ -395,7 +387,7 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, if (client_.get()) handler = client_->GetPrintHandler(); - if(handler.get()) { + if (handler.get()) { saved_state = SaveDC(hDC); DCHECK_NE(saved_state, 0); @@ -411,11 +403,11 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, (settings.page_setup_pixels().physical_size().height() - settings.page_setup_pixels().printable_area().bottom())); - const double scale = static_cast(settings.dpi()) / + const double scale = static_cast(settings.dpi()) / static_cast(settings.desired_dpi); CefPrintInfo printInfo; - + printInfo.m_hDC = hDC; printInfo.m_Rect = rect; printInfo.m_Scale = scale; @@ -435,47 +427,47 @@ void CefBrowserImpl::UIT_PrintPage(int page_number, int total_pages, // Draw handler-defined headers and/or footers. LOGFONT lf; memset(&lf, 0, sizeof(lf)); - lf.lfHeight = (int)ceil(10. * scale); - lf.lfPitchAndFamily = FF_SWISS; + lf.lfHeight = static_cast(ceil(10. * scale)); + lf.lfPitchAndFamily = FF_SWISS; HFONT hFont = CreateFontIndirect(&lf); HFONT hOldFont = (HFONT)SelectObject(hDC, hFont); - COLORREF hOldColor = SetTextColor(hDC, RGB(0,0,0)); + COLORREF hOldColor = SetTextColor(hDC, RGB(0, 0, 0)); int hOldBkMode = SetBkMode(hDC, TRANSPARENT); // TODO(cef): Keep the header strings inside a reasonable bounding box // so that they don't overlap each other. - if(topLeft.length() > 0) { + if (topLeft.length() > 0) { std::wstring topLeftStr(topLeft); DrawText(hDC, topLeftStr.c_str(), topLeftStr.length(), &rect, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_END_ELLIPSIS | DT_EXPANDTABS | DT_NOPREFIX); } - if(topCenter.length() > 0) { + if (topCenter.length() > 0) { std::wstring topCenterStr(topCenter); DrawText(hDC, topCenterStr.c_str(), topCenterStr.length(), &rect, DT_CENTER | DT_TOP | DT_SINGLELINE | DT_END_ELLIPSIS | DT_EXPANDTABS | DT_NOPREFIX); } - if(topRight.length() > 0) { + if (topRight.length() > 0) { std::wstring topRightStr(topRight); DrawText(hDC, topRightStr.c_str(), topRightStr.length(), &rect, DT_RIGHT | DT_TOP | DT_SINGLELINE | DT_END_ELLIPSIS | DT_EXPANDTABS | DT_NOPREFIX); } - if(bottomLeft.length() > 0) { + if (bottomLeft.length() > 0) { std::wstring bottomLeftStr(bottomLeft); DrawText(hDC, bottomLeftStr.c_str(), bottomLeftStr.length(), &rect, DT_LEFT | DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_EXPANDTABS | DT_NOPREFIX); } - if(bottomCenter.length() > 0) { + if (bottomCenter.length() > 0) { std::wstring bottomCenterStr(bottomCenter); DrawText(hDC, bottomCenterStr.c_str(), bottomCenterStr.length(), &rect, DT_CENTER | DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS | DT_EXPANDTABS | DT_NOPREFIX); } - if(bottomRight.length() > 0) { + if (bottomRight.length() > 0) { std::wstring bottomRightStr(bottomRight); DrawText(hDC, bottomRightStr.c_str(), bottomRightStr.length(), &rect, DT_RIGHT | DT_BOTTOM | DT_SINGLELINE | DT_END_ELLIPSIS @@ -503,12 +495,12 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { // Make a copy of settings. printing::PrintSettings settings = print_context_.settings(); CefPrintOptions print_options; - settings.UpdatePrintOptions(print_options); - + settings.UpdatePrintOptions(print_options); + CefRefPtr handler; if (client_.get()) handler = client_->GetPrintHandler(); - + // Ask the handler if they want to update the print options. if (handler.get() && handler->GetPrintOptions(this, print_options)) { settings.UpdateFromPrintOptions(print_options); @@ -516,19 +508,19 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { } } - if(print_context_.AskUserForSettings( + if (print_context_.AskUserForSettings( UIT_GetMainWndHandle(), UIT_GetPagesCount(frame), false) != printing::PrintingContext::OK) return; printing::PrintParams params; const printing::PrintSettings &settings = print_context_.settings(); - + settings.RenderParams(¶ms); int page_count = 0; gfx::Size canvas_size; - + canvas_size.set_width( printing::ConvertUnit( settings.page_setup_pixels().content_area().width(), @@ -546,14 +538,14 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { MessageLoop::current()->SetNestableTasksAllowed(false); if (print_context_.NewDocument(title_) == printing::PrintingContext::OK) { - if(settings.ranges.size() > 0) { + if (settings.ranges.size() > 0) { for (unsigned x = 0; x < settings.ranges.size(); ++x) { const printing::PageRange& range = settings.ranges[x]; - for(int i = range.from; i <= range.to; ++i) + for (int i = range.from; i <= range.to; ++i) UIT_PrintPage(i, page_count, canvas_size, frame); } } else { - for(int i = 0; i < page_count; ++i) + for (int i = 0; i < page_count; ++i) UIT_PrintPage(i, page_count, canvas_size, frame); } print_context_.DocumentDone(); @@ -565,22 +557,21 @@ void CefBrowserImpl::UIT_PrintPages(WebKit::WebFrame* frame) { frame->printEnd(); } -int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) -{ +int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) { REQUIRE_UIT(); - + printing::PrintParams params; const printing::PrintSettings &settings = print_context_.settings(); - + settings.RenderParams(¶ms); // The dbi will be 0 if no default printer is configured. - if(params.dpi == 0) + if (params.dpi == 0) return 0; int page_count = 0; gfx::Size canvas_size; - + canvas_size.set_width( printing::ConvertUnit( settings.page_setup_pixels().content_area().width(), @@ -598,13 +589,11 @@ int CefBrowserImpl::UIT_GetPagesCount(WebKit::WebFrame* frame) } // static -void CefBrowserImpl::UIT_CloseView(gfx::NativeView view) -{ +void CefBrowserImpl::UIT_CloseView(gfx::NativeView view) { PostMessage(view, WM_CLOSE, 0, 0); } // static -bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view) -{ +bool CefBrowserImpl::UIT_IsViewVisible(gfx::NativeView view) { return IsWindowVisible(view) ? true : false; } diff --git a/libcef/browser_navigation_controller.cc b/libcef/browser_navigation_controller.cc index 6ad9138d4..d6cbeec74 100644 --- a/libcef/browser_navigation_controller.cc +++ b/libcef/browser_navigation_controller.cc @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_navigation_controller.h" -#include "browser_impl.h" +#include "libcef/browser_navigation_controller.h" +#include "libcef/browser_impl.h" #include "base/logging.h" #include "net/base/upload_data.h" @@ -29,7 +29,7 @@ BrowserNavigationEntry::BrowserNavigationEntry(int page_id, method_(method), headers_(headers), target_frame_(target_frame) { - if(!upload.isNull()) + if (!upload.isNull()) upload_ = upload; } @@ -88,8 +88,8 @@ void BrowserNavigationController::GoToOffset(int offset) { } void BrowserNavigationController::GoToIndex(int index) { - DCHECK(index >= 0); - DCHECK(index < static_cast(entries_.size())); + DCHECK_GE(index, 0); + DCHECK_LT(index, static_cast(entries_.size())); DiscardPendingEntry(); @@ -233,7 +233,7 @@ void BrowserNavigationController::NavigateToPendingEntry(bool reload, bool ignoreCache) { // For session history navigations only the pending_entry_index_ is set. if (!pending_entry_) { - DCHECK(pending_entry_index_ != -1); + DCHECK_NE(pending_entry_index_, -1); pending_entry_ = entries_[pending_entry_index_].get(); } diff --git a/libcef/browser_navigation_controller.h b/libcef/browser_navigation_controller.h index fa3e876be..d4b0642d3 100644 --- a/libcef/browser_navigation_controller.h +++ b/libcef/browser_navigation_controller.h @@ -3,8 +3,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_NAVIGATION_CONTROLLER_H -#define _BROWSER_NAVIGATION_CONTROLLER_H +#ifndef CEF_LIBCEF_BROWSER_NAVIGATION_CONTROLLER_H_ +#define CEF_LIBCEF_BROWSER_NAVIGATION_CONTROLLER_H_ +#pragma once #include #include @@ -24,7 +25,7 @@ class CefBrowserImpl; // Associated with browser-initated navigations to hold tracking data. class BrowserExtraData : public WebKit::WebDataSource::ExtraData { public: - BrowserExtraData(int32 pending_page_id) + explicit BrowserExtraData(int32 pending_page_id) : pending_page_id(pending_page_id), request_committed(false) { } @@ -76,7 +77,7 @@ class BrowserNavigationEntry { const WebKit::WebHTTPBody& GetUploadData() const { return upload_; } const CefRequest::HeaderMap& GetHeaders() const { return headers_; } -private: + private: // Describes the current page that the tab represents. This is not relevant // for all tab contents types. int32 page_id_; @@ -97,7 +98,7 @@ private: // version as possible. class BrowserNavigationController { public: - BrowserNavigationController(CefBrowserImpl* browser); + explicit BrowserNavigationController(CefBrowserImpl* browser); ~BrowserNavigationController(); void Reset(); @@ -208,5 +209,5 @@ class BrowserNavigationController { DISALLOW_EVIL_CONSTRUCTORS(BrowserNavigationController); }; -#endif // _BROWSER_NAVIGATION_CONTROLLER_H +#endif // CEF_LIBCEF_BROWSER_NAVIGATION_CONTROLLER_H_ diff --git a/libcef/browser_persistent_cookie_store.cc b/libcef/browser_persistent_cookie_store.cc index 80be5f2d1..22f3f0596 100644 --- a/libcef/browser_persistent_cookie_store.cc +++ b/libcef/browser_persistent_cookie_store.cc @@ -3,14 +3,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_persistent_cookie_store.h" -#include "cef_thread.h" +#include "libcef/browser_persistent_cookie_store.h" #include #include #include #include +#include "libcef/cef_thread.h" + #include "base/basictypes.h" #include "base/bind.h" #include "base/callback.h" @@ -92,7 +93,8 @@ class BrowserPersistentCookieStore::Backend void SetClearLocalStateOnExit(bool clear_local_state); private: - friend class base::RefCountedThreadSafe; + friend class base::RefCountedThreadSafe< + BrowserPersistentCookieStore::Backend>; // You should call Close() before destructing this object. ~Backend() { @@ -331,7 +333,7 @@ bool BrowserPersistentCookieStore::Backend::InitializeDatabase() { return false; } - //db_->set_error_delegate(GetErrorHandlerForCookieDb()); + // db_->set_error_delegate(GetErrorHandlerForCookieDb()); if (!EnsureDatabaseVersion() || !InitTable(db_.get())) { NOTREACHED() << "Unable to open cookie DB."; diff --git a/libcef/browser_persistent_cookie_store.h b/libcef/browser_persistent_cookie_store.h index ad18806e4..61fafa5bc 100644 --- a/libcef/browser_persistent_cookie_store.h +++ b/libcef/browser_persistent_cookie_store.h @@ -4,13 +4,14 @@ // A sqlite implementation of a cookie monster persistent store. -// This class is based on src/chrome/browser/net/sqlite_persistent_cookie_store.h +// This class is based on src/chrome/browser/net/ +// sqlite_persistent_cookie_store.h // with the following modifications for use in the cef: // - BrowserThread has been replaced with CefThread // - Performance diagnostic code has been removed (UMA_HISTOGRAM_ENUMERATION) -#ifndef _BROWSER_PERSISTENT_COOKIE_STORE_H -#define _BROWSER_PERSISTENT_COOKIE_STORE_H +#ifndef CEF_LIBCEF_BROWSER_PERSISTENT_COOKIE_STORE_H_ +#define CEF_LIBCEF_BROWSER_PERSISTENT_COOKIE_STORE_H_ #pragma once #include @@ -59,4 +60,4 @@ class BrowserPersistentCookieStore DISALLOW_COPY_AND_ASSIGN(BrowserPersistentCookieStore); }; -#endif // _BROWSER_PERSISTENT_COOKIE_STORE_H +#endif // CEF_LIBCEF_BROWSER_PERSISTENT_COOKIE_STORE_H_ diff --git a/libcef/browser_request_context.cc b/libcef/browser_request_context.cc index e35caa899..12cab888f 100644 --- a/libcef/browser_request_context.cc +++ b/libcef/browser_request_context.cc @@ -3,12 +3,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_request_context.h" -#include "browser_file_system.h" -#include "browser_persistent_cookie_store.h" -#include "browser_resource_loader_bridge.h" -#include "cef_context.h" -#include "cef_thread.h" +#include "libcef/browser_request_context.h" + +#if defined(OS_WIN) +#include +#endif + +#include "libcef/browser_file_system.h" +#include "libcef/browser_persistent_cookie_store.h" +#include "libcef/browser_resource_loader_bridge.h" +#include "libcef/cef_context.h" +#include "libcef/cef_thread.h" #include "base/compiler_specific.h" #include "base/file_path.h" @@ -37,10 +42,8 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_WIN) -#include #pragma comment(lib, "winhttp.lib") -#endif // defined(OS_WIN) - +#endif namespace { @@ -48,7 +51,7 @@ namespace { // ProxyConfigService implementation that does nothing. class ProxyConfigServiceNull : public net::ProxyConfigService { -public: + public: ProxyConfigServiceNull() {} virtual void AddObserver(Observer* observer) OVERRIDE {} virtual void RemoveObserver(Observer* observer) OVERRIDE {} @@ -58,12 +61,12 @@ public: virtual void OnLazyPoll() OVERRIDE {} }; -#endif // defined(OS_WIN) +#endif // defined(OS_WIN) // ProxyResolver implementation that forewards resolution to a CefProxyHandler. class CefProxyResolver : public net::ProxyResolver { -public: - CefProxyResolver(CefRefPtr handler) + public: + explicit CefProxyResolver(CefRefPtr handler) : ProxyResolver(false), handler_(handler) {} virtual ~CefProxyResolver() {} @@ -72,8 +75,7 @@ public: net::ProxyInfo* results, const net::CompletionCallback& callback, RequestHandle* request, - const net::BoundNetLog& net_log) OVERRIDE - { + const net::BoundNetLog& net_log) OVERRIDE { CefProxyInfo proxy_info; handler_->GetProxyForUrl(url.spec(), proxy_info); if (proxy_info.IsDirect()) @@ -84,23 +86,25 @@ public: results->UsePacString(proxy_info.ProxyList()); return net::OK; - } + } virtual int SetPacScript( const scoped_refptr& pac_script, - const net::CompletionCallback& callback) OVERRIDE - { + const net::CompletionCallback& callback) OVERRIDE { return net::OK; } virtual void CancelRequest(RequestHandle request) OVERRIDE {} - virtual net::LoadState GetLoadState(RequestHandle request) const OVERRIDE - { return net::LOAD_STATE_IDLE; } + virtual net::LoadState GetLoadState(RequestHandle request) const OVERRIDE { + return net::LOAD_STATE_IDLE; + } virtual net::LoadState GetLoadStateThreadSafe(RequestHandle request) const - OVERRIDE { return net::LOAD_STATE_IDLE; } + OVERRIDE { + return net::LOAD_STATE_IDLE; + } virtual void CancelSetPacScript() OVERRIDE {} -protected: + protected: CefRefPtr handler_; }; @@ -121,10 +125,10 @@ net::ProxyConfigService* CreateProxyConfigService() { #endif } -} // namespace +} // namespace -BrowserRequestContext::BrowserRequestContext() +BrowserRequestContext::BrowserRequestContext() : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)), accept_all_cookies_(true) { Init(FilePath(), net::HttpCache::NORMAL, false); @@ -200,8 +204,8 @@ void BrowserRequestContext::Init( } } } -#endif // defined(OS_WIN) - +#endif // defined(OS_WIN) + if (!proxy_service()) { storage_.set_proxy_service( net::ProxyService::CreateUsingSystemProxyResolver( @@ -241,7 +245,7 @@ void BrowserRequestContext::Init( new net::HttpCache(host_resolver(), cert_verifier(), origin_bound_cert_service(), - NULL, // transport_security_state + NULL, // transport_security_state proxy_service(), "", // ssl_session_cache_shard ssl_config_service(), @@ -296,7 +300,7 @@ bool BrowserRequestContext::AcceptAllCookies() { void BrowserRequestContext::SetCookieStoragePath(const FilePath& path) { REQUIRE_IOT(); - + if (cookie_store() && ((cookie_store_path_.empty() && path.empty()) || cookie_store_path_ == path)) { // The path has not changed so don't do anything. diff --git a/libcef/browser_request_context.h b/libcef/browser_request_context.h index 2cb98c21c..27d2d6cc5 100644 --- a/libcef/browser_request_context.h +++ b/libcef/browser_request_context.h @@ -3,8 +3,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_REQUEST_CONTEXT_H -#define _BROWSER_REQUEST_CONTEXT_H +#ifndef CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_ +#define CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_ +#pragma once + +#include #include "net/http/http_cache.h" #include "net/http/url_security_manager.h" @@ -57,5 +60,5 @@ class BrowserRequestContext : public net::URLRequestContext { bool accept_all_cookies_; }; -#endif // _BROWSER_REQUEST_CONTEXT_H +#endif // CEF_LIBCEF_BROWSER_REQUEST_CONTEXT_H_ diff --git a/libcef/browser_resource_loader_bridge.cc b/libcef/browser_resource_loader_bridge.cc index 962149012..7f4b7fa24 100644 --- a/libcef/browser_resource_loader_bridge.cc +++ b/libcef/browser_resource_loader_bridge.cc @@ -31,19 +31,19 @@ // perform URL loads. See renderer/resource_dispatcher.h for details on an // alternate implementation that defers fetching to another process. -#include "browser_appcache_system.h" -#include "browser_resource_loader_bridge.h" -#include "browser_request_context.h" -#include "browser_socket_stream_bridge.h" -#include "browser_webkit_glue.h" -#include "browser_impl.h" -#include "cef_context.h" -#include "cef_process.h" -#include "cef_process_io_thread.h" -#include "external_protocol_handler.h" -#include "request_impl.h" -#include "response_impl.h" -#include "http_header_utils.h" +#include "libcef/browser_resource_loader_bridge.h" +#include "libcef/browser_appcache_system.h" +#include "libcef/browser_request_context.h" +#include "libcef/browser_socket_stream_bridge.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/browser_impl.h" +#include "libcef/cef_context.h" +#include "libcef/cef_process.h" +#include "libcef/cef_process_io_thread.h" +#include "libcef/external_protocol_handler.h" +#include "libcef/request_impl.h" +#include "libcef/response_impl.h" +#include "libcef/http_header_utils.h" #include "base/bind.h" #include "base/file_path.h" @@ -114,13 +114,13 @@ struct RequestParams { static const int kUpdateUploadProgressIntervalMsec = 100; class ExtraRequestInfo : public net::URLRequest::UserData { -public: + public: ExtraRequestInfo(CefBrowser* browser, ResourceType::Type resource_type) : browser_(browser), resource_type_(resource_type), - allow_download_(resource_type == ResourceType::MAIN_FRAME || - resource_type == ResourceType::SUB_FRAME) - { } + allow_download_(resource_type == ResourceType::MAIN_FRAME || + resource_type == ResourceType::SUB_FRAME) { + } // The browser pointer is guaranteed to be valid for the lifespan of the // request. The pointer will be NULL in cases where the request was @@ -131,23 +131,23 @@ public: ResourceType::Type resource_type() const { return resource_type_; } bool allow_download() const { return allow_download_; } -private: + private: CefBrowser* browser_; ResourceType::Type resource_type_; bool allow_download_; }; // Used to intercept redirect requests. -class RequestInterceptor : public net::URLRequest::Interceptor -{ -public: +class RequestInterceptor : public net::URLRequest::Interceptor { + public: RequestInterceptor() { REQUIRE_IOT(); net::URLRequestJobManager::GetInstance()->RegisterRequestInterceptor(this); } ~RequestInterceptor() { REQUIRE_IOT(); - net::URLRequestJobManager::GetInstance()->UnregisterRequestInterceptor(this); + net::URLRequestJobManager::GetInstance()-> + UnregisterRequestInterceptor(this); } virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) @@ -195,14 +195,13 @@ class RequestProxy : public net::URLRequest::Delegate, public base::RefCountedThreadSafe { public: // Takes ownership of the params. - RequestProxy(CefRefPtr browser) + explicit RequestProxy(CefRefPtr browser) : download_to_file_(false), buf_(new net::IOBuffer(kDataSize)), browser_(browser), last_upload_position_(0), defers_loading_(false), - defers_loading_want_read_(false) - { + defers_loading_want_read_(false) { } void DropPeer() { @@ -221,7 +220,7 @@ class RequestProxy : public net::URLRequest::Delegate, } void Cancel() { - if(download_handler_.get()) { + if (download_handler_.get()) { // WebKit will try to cancel the download but we won't allow it. return; } @@ -270,13 +269,12 @@ class RequestProxy : public net::URLRequest::Delegate, void NotifyReceivedResponse(const ResourceResponseInfo& info, const GURL& url, bool allow_download) { - if (browser_.get() && info.headers.get()) { CefRefPtr client = browser_->GetClient(); CefRefPtr handler; if (client.get()) handler = client->GetRequestHandler(); - + if (handler.get()) { CefRefPtr response = new CefResponseImpl(); // Transfer response headers @@ -340,9 +338,9 @@ class RequestProxy : public net::URLRequest::Delegate, CefRefPtr resourceStream; - if(content_filter_.get()) + if (content_filter_.get()) content_filter_->ProcessData(buf_copy.get(), bytes_read, resourceStream); - + if (resourceStream.get()) { // The filter made some changes to the data in the buffer. resourceStream->Seek(0, SEEK_END); @@ -377,16 +375,15 @@ class RequestProxy : public net::URLRequest::Delegate, void NotifyCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::TimeTicks& complete_time) { - - // Drain the content filter of all remaining data + // Drain the content filter of all remaining data if (content_filter_.get()) { CefRefPtr remainder; content_filter_->Drain(remainder); - if(remainder.get()) { + if (remainder.get()) { remainder->Seek(0, SEEK_END); - long size = remainder->Tell(); - if (size) { + int size = static_cast(remainder->Tell()); + if (size > 0) { remainder->Seek(0, SEEK_SET); scoped_array buf(new char[size]); remainder->Read(buf.get(), 1, size); @@ -433,8 +430,8 @@ class RequestProxy : public net::URLRequest::Delegate, CefRefPtr handler; if (client.get()) handler = client->GetRequestHandler(); - - if(handler.get()) { + + if (handler.get()) { // Build the request object for passing to the handler CefRefPtr request(new CefRequestImpl()); CefRequestImpl* requestimpl = @@ -443,7 +440,7 @@ class RequestProxy : public net::URLRequest::Delegate, std::string originalUrl(params->url.spec()); requestimpl->SetURL(originalUrl); requestimpl->SetMethod(params->method); - + // Transfer request headers CefRequest::HeaderMap headerMap; HttpHeaderUtils::ParseHeaders(params->headers, headerMap); @@ -452,7 +449,7 @@ class RequestProxy : public net::URLRequest::Delegate, // Transfer post data, if any scoped_refptr upload = params->upload; - if(upload.get()) { + if (upload.get()) { CefRefPtr postdata(new CefPostDataImpl()); static_cast(postdata.get())->Set(*upload.get()); requestimpl->SetPostData(postdata); @@ -470,9 +467,9 @@ class RequestProxy : public net::URLRequest::Delegate, if (!handled) { // Observe URL from request. const std::string requestUrl(request->GetURL()); - if(requestUrl != originalUrl) { + if (requestUrl != originalUrl) { params->url = GURL(requestUrl); - redirectUrl.clear(); // Request URL trumps redirect URL + redirectUrl.clear(); // Request URL trumps redirect URL } // Observe method from request. @@ -482,8 +479,9 @@ class RequestProxy : public net::URLRequest::Delegate, request->GetHeaderMap(headerMap); CefString referrerStr; referrerStr.FromASCII("Referrer"); - CefRequest::HeaderMap::iterator referrer = headerMap.find(referrerStr); - if(referrer == headerMap.end()) { + CefRequest::HeaderMap::iterator referrer = + headerMap.find(referrerStr); + if (referrer == headerMap.end()) { params->referrer = GURL(); } else { params->referrer = GURL(std::string(referrer->second)); @@ -493,7 +491,7 @@ class RequestProxy : public net::URLRequest::Delegate, // Observe post data from request. CefRefPtr postData = request->GetPostData(); - if(postData.get()) { + if (postData.get()) { params->upload = new net::UploadData(); static_cast(postData.get())->Get(*params->upload); } @@ -517,7 +515,7 @@ class RequestProxy : public net::URLRequest::Delegate, handled = true; resourceStream->Seek(0, SEEK_END); - long offset = resourceStream->Tell(); + int64 offset = resourceStream->Tell(); resourceStream->Seek(0, SEEK_SET); resource_stream_ = resourceStream; @@ -526,7 +524,7 @@ class RequestProxy : public net::URLRequest::Delegate, static_cast(response.get()); ResourceResponseInfo info; - info.content_length = static_cast(offset); + info.content_length = offset; info.mime_type = response->GetMimeType(); info.headers = responseImpl->GetResponseHeaders(); OnReceivedResponse(info, params->url); @@ -559,13 +557,13 @@ class RequestProxy : public net::URLRequest::Delegate, if (handled) { OnCompletedRequest( URLRequestStatus(URLRequestStatus::HANDLED_EXTERNALLY, net::OK), - std::string(), base::TimeTicks()); + std::string(), base::TimeTicks()); } } } } - if(!handled) { + if (!handled) { // Might need to resolve the blob references in the upload data. if (params->upload) { _Context->request_context()->blob_storage_controller()-> @@ -652,10 +650,10 @@ class RequestProxy : public net::URLRequest::Delegate, return; } - if(resource_stream_.get()) { + if (resource_stream_.get()) { // Read from the handler-provided resource stream int bytes_read = resource_stream_->Read(buf_->data(), 1, kDataSize); - if(bytes_read > 0) { + if (bytes_read > 0) { OnReceivedData(bytes_read); } else { Done(); @@ -699,7 +697,7 @@ class RequestProxy : public net::URLRequest::Delegate, const GURL& simulated_url) { GURL url; bool allow_download(false); - if (request_.get()){ + if (request_.get()) { url = request_->url(); ExtraRequestInfo* info = static_cast(request_->GetUserData(kCefUserData)); @@ -721,7 +719,7 @@ class RequestProxy : public net::URLRequest::Delegate, &RequestProxy::NotifyDownloadedData, this, bytes_read)); return; } - + owner_loop_->PostTask(FROM_HERE, base::Bind( &RequestProxy::NotifyReceivedData, this, bytes_read)); } @@ -766,7 +764,7 @@ class RequestProxy : public net::URLRequest::Delegate, CefRefPtr client = browser_->GetClient(); if (client.get()) { CefRefPtr handler = client->GetRequestHandler(); - if(handler.get()) { + if (handler.get()) { CefString username, password; if (handler->GetAuthCredentials(browser_, auth_info->is_proxy, @@ -833,12 +831,12 @@ class RequestProxy : public net::URLRequest::Delegate, // Helpers and data: void Done() { - if(resource_stream_.get()) { + if (resource_stream_.get()) { // Resource stream reads always complete successfully OnCompletedRequest(URLRequestStatus(URLRequestStatus::SUCCESS, 0), std::string(), base::TimeTicks()); resource_stream_ = NULL; - } else if(request_.get()) { + } else if (request_.get()) { if (upload_progress_timer_.IsRunning()) { MaybeUpdateUploadProgress(); upload_progress_timer_.Stop(); @@ -990,7 +988,7 @@ class SyncRequestProxy : public RequestProxy { const base::TimeTicks& complete_time) { if (download_to_file_) file_stream_.Close(); - + result_->status = status; event_.Signal(); } @@ -1230,13 +1228,13 @@ CefRefPtr BrowserResourceLoaderBridge::GetBrowserForRequest( return NULL; } -//static +// static scoped_refptr BrowserResourceLoaderBridge::GetCacheThread() { return CefThread::GetMessageLoopProxyForThread(CefThread::FILE); } -//static +// static net::URLRequest::Interceptor* BrowserResourceLoaderBridge::CreateRequestInterceptor() { return new RequestInterceptor(); diff --git a/libcef/browser_resource_loader_bridge.h b/libcef/browser_resource_loader_bridge.h index 6f6790f13..47219ea2d 100644 --- a/libcef/browser_resource_loader_bridge.h +++ b/libcef/browser_resource_loader_bridge.h @@ -3,14 +3,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_RESOURCE_LOADER_BRIDGE_H -#define _BROWSER_RESOURCE_LOADER_BRIDGE_H +#ifndef CEF_LIBCEF_BROWSER_RESOURCE_LOADER_BRIDGE_H_ +#define CEF_LIBCEF_BROWSER_RESOURCE_LOADER_BRIDGE_H_ +#pragma once + +#include #include "include/cef_base.h" #include "base/message_loop_proxy.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_loader_bridge.h" -#include class CefBrowser; class GURL; @@ -41,5 +43,5 @@ class BrowserResourceLoaderBridge { static net::URLRequest::Interceptor* CreateRequestInterceptor(); }; -#endif // _BROWSER_RESOURCE_LOADER_BRIDGE_H +#endif // CEF_LIBCEF_BROWSER_RESOURCE_LOADER_BRIDGE_H_ diff --git a/libcef/browser_settings.cc b/libcef/browser_settings.cc index f8516a970..1dcd7a05b 100644 --- a/libcef/browser_settings.cc +++ b/libcef/browser_settings.cc @@ -2,23 +2,22 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "browser_settings.h" +#include "libcef/browser_settings.h" #include "include/internal/cef_types_wrappers.h" #include "base/utf_string_conversions.h" #include "webkit/glue/webpreferences.h" -void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) -{ +void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) { if (cef.standard_font_family.length > 0) web.standard_font_family = CefString(&cef.standard_font_family); else web.standard_font_family = ASCIIToUTF16("Times"); - + if (cef.fixed_font_family.length > 0) web.fixed_font_family = CefString(&cef.fixed_font_family); else web.fixed_font_family = ASCIIToUTF16("Courier"); - + if (cef.serif_font_family.length > 0) web.serif_font_family = CefString(&cef.serif_font_family); else @@ -31,10 +30,10 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) // These two fonts below are picked from the intersection of // Win XP font list and Vista font list : - // http://www.microsoft.com/typography/fonts/winxp.htm + // http://www.microsoft.com/typography/fonts/winxp.htm // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx // Some of them are installed only with CJK and complex script - // support enabled on Windows XP and are out of consideration here. + // support enabled on Windows XP and are out of consideration here. // (although we enabled both on our buildbots.) // They (especially Impact for fantasy) are not typical cursive // and fantasy fonts, but it should not matter for layout tests @@ -79,7 +78,7 @@ void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) web.minimum_logical_font_size = cef.minimum_logical_font_size; else web.minimum_logical_font_size = 9; - + if (cef.default_encoding.length > 0) web.default_encoding = CefString(&cef.default_encoding); else diff --git a/libcef/browser_settings.h b/libcef/browser_settings.h index dc762a093..722009dbe 100644 --- a/libcef/browser_settings.h +++ b/libcef/browser_settings.h @@ -2,12 +2,13 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#ifndef _CEF_BROWSER_SETTINGS_H -#define _CEF_BROWSER_SETTINGS_H +#ifndef CEF_LIBCEF_BROWSER_SETTINGS_H_ +#define CEF_LIBCEF_BROWSER_SETTINGS_H_ +#pragma once #include "include/internal/cef_types_wrappers.h" struct WebPreferences; void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web); -#endif // _CEF_BROWSER_SETTINGS_H +#endif // CEF_LIBCEF_BROWSER_SETTINGS_H_ diff --git a/libcef/browser_socket_stream_bridge.cc b/libcef/browser_socket_stream_bridge.cc index 431226bad..53ffe7c27 100644 --- a/libcef/browser_socket_stream_bridge.cc +++ b/libcef/browser_socket_stream_bridge.cc @@ -4,7 +4,7 @@ #include -#include "browser_socket_stream_bridge.h" +#include "libcef/browser_socket_stream_bridge.h" #include "base/atomicops.h" #include "base/bind.h" diff --git a/libcef/browser_socket_stream_bridge.h b/libcef/browser_socket_stream_bridge.h index 5ca2135c9..a59ac09a4 100644 --- a/libcef/browser_socket_stream_bridge.h +++ b/libcef/browser_socket_stream_bridge.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_SOCKET_STREAM_BRIDGE_H -#define _BROWSER_SOCKET_STREAM_BRIDGE_H +#ifndef CEF_LIBCEF_BROWSER_SOCKET_STREAM_BRIDGE_H_ +#define CEF_LIBCEF_BROWSER_SOCKET_STREAM_BRIDGE_H_ +#pragma once #include "base/basictypes.h" @@ -32,4 +33,4 @@ class BrowserSocketStreamBridge { DISALLOW_IMPLICIT_CONSTRUCTORS(BrowserSocketStreamBridge); }; -#endif // _BROWSER_SOCKET_STREAM_BRIDGE_H +#endif // CEF_LIBCEF_BROWSER_SOCKET_STREAM_BRIDGE_H_ diff --git a/libcef/browser_webblobregistry_impl.cc b/libcef/browser_webblobregistry_impl.cc index ddf7b0d2a..56257f384 100644 --- a/libcef/browser_webblobregistry_impl.cc +++ b/libcef/browser_webblobregistry_impl.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webblobregistry_impl.h" +#include "libcef/browser_webblobregistry_impl.h" #include "base/bind.h" #include "base/message_loop.h" diff --git a/libcef/browser_webblobregistry_impl.h b/libcef/browser_webblobregistry_impl.h index f8a7df31c..5aa7a6706 100644 --- a/libcef/browser_webblobregistry_impl.h +++ b/libcef/browser_webblobregistry_impl.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BROWSER_WEBBLOBREGISTRY_IMPL_H_ -#define BROWSER_WEBBLOBREGISTRY_IMPL_H_ +#ifndef CEF_LIBCEF_BROWSER_WEBBLOBREGISTRY_IMPL_H_ +#define CEF_LIBCEF_BROWSER_WEBBLOBREGISTRY_IMPL_H_ +#pragma once #include "base/memory/ref_counted.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegistry.h" @@ -43,4 +44,4 @@ class BrowserWebBlobRegistryImpl DISALLOW_COPY_AND_ASSIGN(BrowserWebBlobRegistryImpl); }; -#endif // BROWSER_WEBBLOBREGISTRY_IMPL_H_ +#endif // CEF_LIBCEF_BROWSER_WEBBLOBREGISTRY_IMPL_H_ diff --git a/libcef/browser_webcookiejar_impl.cc b/libcef/browser_webcookiejar_impl.cc index 8e7af8b86..3ce8d0eaa 100644 --- a/libcef/browser_webcookiejar_impl.cc +++ b/libcef/browser_webcookiejar_impl.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webcookiejar_impl.h" -#include "browser_resource_loader_bridge.h" +#include "libcef/browser_webcookiejar_impl.h" +#include "libcef/browser_resource_loader_bridge.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" diff --git a/libcef/browser_webcookiejar_impl.h b/libcef/browser_webcookiejar_impl.h index d62f1d6d4..705f0d133 100644 --- a/libcef/browser_webcookiejar_impl.h +++ b/libcef/browser_webcookiejar_impl.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_SIMPLE_WEBCOOKIEJAR_IMPL_H -#define _BROWSER_SIMPLE_WEBCOOKIEJAR_IMPL_H +#ifndef CEF_LIBCEF_BROWSER_WEBCOOKIEJAR_IMPL_H_ +#define CEF_LIBCEF_BROWSER_WEBCOOKIEJAR_IMPL_H_ +#pragma once // TODO(darin): WebCookieJar.h is missing a WebString.h include! #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" @@ -19,4 +20,4 @@ class BrowserWebCookieJarImpl : public WebKit::WebCookieJar { const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies); }; -#endif // _BROWSER_SIMPLE_WEBCOOKIEJAR_IMPL_H +#endif // CEF_LIBCEF_BROWSER_WEBCOOKIEJAR_IMPL_H_ diff --git a/libcef/browser_webkit_glue.cc b/libcef/browser_webkit_glue.cc index c78bdbfa1..3d0783f96 100644 --- a/libcef/browser_webkit_glue.cc +++ b/libcef/browser_webkit_glue.cc @@ -3,21 +3,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/compiler_specific.h" +#include "libcef/browser_webkit_glue.h" #include "third_party/WebKit/Source/WebCore/config.h" MSVC_PUSH_WARNING_LEVEL(0); -#include "ApplicationCacheStorage.h" -#include "CrossOriginPreflightResultCache.h" -#include "DocumentLoader.h" -#include "MemoryCache.h" -#include "TextEncoding.h" +#include "ApplicationCacheStorage.h" // NOLINT(build/include) +#include "CrossOriginPreflightResultCache.h" // NOLINT(build/include) +#include "DocumentLoader.h" // NOLINT(build/include) +#include "MemoryCache.h" // NOLINT(build/include) +#include "TextEncoding.h" // NOLINT(build/include) #include "third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.h" MSVC_POP_WARNING(); #undef LOG -#include "browser_webkit_glue.h" -#include "cef_context.h" +#include "libcef/cef_context.h" #include "base/file_util.h" #include "base/logging.h" @@ -75,15 +74,13 @@ void InitializeTextEncoding() { WebCore::UTF8Encoding(); } -v8::Handle GetV8Context(WebKit::WebFrame* frame) -{ +v8::Handle GetV8Context(WebKit::WebFrame* frame) { WebFrameImpl* webFrameImpl = static_cast(frame); WebCore::Frame* core_frame = webFrameImpl->frame(); return WebCore::V8Proxy::context(core_frame); } -void ClearCache() -{ +void ClearCache() { if (WebCore::memoryCache()->disabled()) return; @@ -109,8 +106,7 @@ bool GetFontTable(int fd, uint32_t table, uint8_t* output, // Adapted from Chromium's BufferedResourceHandler::ShouldDownload bool ShouldDownload(const std::string& content_disposition, - const std::string& mime_type) -{ + const std::string& mime_type) { std::string type = StringToLowerASCII(mime_type); std::string disposition = StringToLowerASCII(content_disposition); @@ -153,7 +149,7 @@ bool ShouldDownload(const std::string& content_disposition, std::vector plugins; webkit::npapi::PluginList::Singleton()->GetPluginInfoArray( GURL(), type, allow_wildcard, NULL, &plugins, NULL); - + // If any associated plugins exist and are enabled don't allow the download. if (!plugins.empty()) { std::vector::const_iterator it = plugins.begin(); diff --git a/libcef/browser_webkit_glue.h b/libcef/browser_webkit_glue.h index 506eafa5e..64c17fcf1 100644 --- a/libcef/browser_webkit_glue.h +++ b/libcef/browser_webkit_glue.h @@ -1,15 +1,21 @@ -// Copyright (c) 2008-2009 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#if defined(OS_WIN) -#include -#endif +#ifndef CEF_LIBCEF_BROWSER_WEBKIT_GLUE_H_ +#define CEF_LIBCEF_BROWSER_WEBKIT_GLUE_H_ +#pragma once + #include +#include "base/compiler_specific.h" #include "base/string_piece.h" #include "v8/include/v8.h" +#if defined(OS_WIN) +#include // NOLINT(build/include_order) +#endif + namespace WebKit { class WebFrame; class WebView; @@ -32,7 +38,7 @@ void CaptureWebViewBitmap(HWND mainWnd, WebKit::WebView* webview, // Save a bitmap image to file, providing optional alternative data in |lpBits| BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits); #endif - + void InitializeResourceBundle(const std::string& locale); void CleanupResourceBundle(); @@ -61,3 +67,5 @@ bool ShouldDownload(const std::string& content_disposition, bool IsPluginEnabled(const webkit::WebPluginInfo& plugin); } // namespace webkit_glue + +#endif // CEF_LIBCEF_BROWSER_WEBKIT_GLUE_H_ diff --git a/libcef/browser_webkit_glue_gtk.cc b/libcef/browser_webkit_glue_gtk.cc index 360e6dd41..d94a098ff 100644 --- a/libcef/browser_webkit_glue_gtk.cc +++ b/libcef/browser_webkit_glue_gtk.cc @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webkit_glue.h" -#include "cef_context.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/cef_context.h" #include "ui/base/resource/resource_bundle.h" namespace webkit_glue { @@ -15,8 +15,9 @@ base::StringPiece GetDataResource(int resource_id) { if (piece.empty()) piece = ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); - DCHECK(!piece.empty()) << "Resource "< #include #include -#include "base/compiler_specific.h" - #include "third_party/WebKit/Source/WebCore/config.h" MSVC_PUSH_WARNING_LEVEL(0); -#include "PlatformContextSkia.h" +#include "PlatformContextSkia.h" // NOLINT(build/include) MSVC_POP_WARNING(); -#include "browser_webkit_glue.h" - #undef LOG #include "base/logging.h" #include "base/path_service.h" @@ -52,7 +50,7 @@ base::StringPiece GetDataResource(int resource_id) { // Try to load the resource from the DLL. if (PathService::Get(base::FILE_MODULE, &file_path)) hModule = ::GetModuleHandle(file_path.value().c_str()); - if(!hModule) + if (!hModule) hModule = ::GetModuleHandle(NULL); piece = GetRawDataResource(hModule, resource_id); @@ -60,7 +58,8 @@ base::StringPiece GetDataResource(int resource_id) { if (piece.empty()) piece = ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); - DCHECK(!piece.empty()) << "Resource "<size(); size.cx = webSize.width; size.cy = webSize.height; - + skia::PlatformCanvas canvas(size.cx, size.cy, true); canvas.drawARGB(255, 255, 255, 255, SkXfermode::kSrc_Mode); WebCore::PlatformContextSkia context(&canvas); @@ -93,7 +91,7 @@ void CaptureWebViewBitmap(HWND mainWnd, WebView* webview, HBITMAP& bitmap, gfx::CreateBitmapV4Header(size.cx, size.cy, &bitmap_header); const SkBitmap& src_bmp = canvas.getDevice()->accessBitmap(true); SkAutoLockPixels src_lock(src_bmp); - int retval = StretchDIBits(hDC, + int retval = StretchDIBits(hDC, 0, 0, size.cx, size.cy, @@ -111,89 +109,86 @@ void CaptureWebViewBitmap(HWND mainWnd, WebView* webview, HBITMAP& bitmap, } -static PBITMAPINFO BmpCreateInfo(HBITMAP hBmp) -{ - BITMAP bmp; - PBITMAPINFO pbmi; - WORD cClrBits; +static PBITMAPINFO BmpCreateInfo(HBITMAP hBmp) { + BITMAP bmp; + PBITMAPINFO pbmi; + WORD cClrBits; - // Retrieve the bitmap color format, width, and height. + // Retrieve the bitmap color format, width, and height. if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&bmp)) { NOTREACHED(); return NULL; } - // Convert the color format to a count of bits. - cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel); - if (cClrBits == 1) { - cClrBits = 1; - } else if (cClrBits <= 4) { - cClrBits = 4; - } else if (cClrBits <= 8) { - cClrBits = 8; - } else if (cClrBits <= 16) { - cClrBits = 16; - } else if (cClrBits <= 24) { - cClrBits = 24; - } else { - cClrBits = 32; + // Convert the color format to a count of bits. + cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel); + if (cClrBits == 1) + cClrBits = 1; + else if (cClrBits <= 4) + cClrBits = 4; + else if (cClrBits <= 8) + cClrBits = 8; + else if (cClrBits <= 16) + cClrBits = 16; + else if (cClrBits <= 24) + cClrBits = 24; + else + cClrBits = 32; + + // Allocate memory for the BITMAPINFO structure. (This structure + // contains a BITMAPINFOHEADER structure and an array of RGBQUAD + // data structures.) + if (cClrBits != 24) { + pbmi = (PBITMAPINFO) LocalAlloc(LPTR, + sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1<< cClrBits)); + } else { // There is no RGBQUAD array for the 24-bit-per-pixel format. + pbmi = (PBITMAPINFO) LocalAlloc(LPTR, sizeof(BITMAPINFOHEADER)); } - // Allocate memory for the BITMAPINFO structure. (This structure - // contains a BITMAPINFOHEADER structure and an array of RGBQUAD - // data structures.) - if (cClrBits != 24) { - pbmi = (PBITMAPINFO) LocalAlloc(LPTR, - sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1<< cClrBits)); - } else { // There is no RGBQUAD array for the 24-bit-per-pixel format. - pbmi = (PBITMAPINFO) LocalAlloc(LPTR, sizeof(BITMAPINFOHEADER)); - } - - // Initialize the fields in the BITMAPINFO structure. - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = bmp.bmWidth; - pbmi->bmiHeader.biHeight = bmp.bmHeight; - pbmi->bmiHeader.biPlanes = bmp.bmPlanes; - pbmi->bmiHeader.biBitCount = bmp.bmBitsPixel; + // Initialize the fields in the BITMAPINFO structure. + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = bmp.bmWidth; + pbmi->bmiHeader.biHeight = bmp.bmHeight; + pbmi->bmiHeader.biPlanes = bmp.bmPlanes; + pbmi->bmiHeader.biBitCount = bmp.bmBitsPixel; if (cClrBits < 24) { pbmi->bmiHeader.biClrUsed = (1<bmiHeader.biCompression = BI_RGB; + // If the bitmap is not compressed, set the BI_RGB flag. + pbmi->bmiHeader.biCompression = BI_RGB; - // Compute the number of bytes in the array of color - // indices and store the result in biSizeImage. - // For Windows NT, the width must be DWORD aligned unless - // the bitmap is RLE compressed. This example shows this. - // For Windows 95/98/Me, the width must be WORD aligned unless the + // Compute the number of bytes in the array of color + // indices and store the result in biSizeImage. + // For Windows NT, the width must be DWORD aligned unless + // the bitmap is RLE compressed. This example shows this. + // For Windows 95/98/Me, the width must be WORD aligned unless the // bitmap is RLE compressed. pbmi->bmiHeader.biSizeImage = ((pbmi->bmiHeader.biWidth * cClrBits +31) & ~31) /8 - * pbmi->bmiHeader.biHeight; - - // Set biClrImportant to 0, indicating that all of the - // device colors are important. - pbmi->bmiHeader.biClrImportant = 0; - return pbmi; -} + * pbmi->bmiHeader.biHeight; + + // Set biClrImportant to 0, indicating that all of the + // device colors are important. + pbmi->bmiHeader.biClrImportant = 0; + return pbmi; +} static BOOL BmpSaveFile(LPCTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, - HDC hDC, LPBYTE lpBits = NULL) -{ - HANDLE hf = INVALID_HANDLE_VALUE; // file handle - BITMAPFILEHEADER hdr; // bitmap file-header - PBITMAPINFOHEADER pbih; // bitmap info-header - DWORD dwTotal; // total count of bytes - DWORD cb; // incremental count of bytes - BYTE *hp; // byte pointer - DWORD dwTmp; + HDC hDC, LPBYTE lpBits = NULL) { + HANDLE hf = INVALID_HANDLE_VALUE; // file handle + BITMAPFILEHEADER hdr; // bitmap file-header + PBITMAPINFOHEADER pbih; // bitmap info-header + DWORD dwTotal; // total count of bytes + DWORD cb; // incremental count of bytes + BYTE* hp; // byte pointer + DWORD dwTmp; BOOL ret = FALSE; BOOL bitsAlloc = FALSE; - pbih = (PBITMAPINFOHEADER) pbi; + pbih = (PBITMAPINFOHEADER) pbi; - if(!lpBits) { + if (!lpBits) { // The bits have not been provided, so retrieve from the bitmap file lpBits = (LPBYTE) GlobalAlloc(GMEM_FIXED, pbih->biSizeImage); if (!lpBits) { @@ -204,8 +199,8 @@ static BOOL BmpSaveFile(LPCTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, bitsAlloc = TRUE; - // Retrieve the color table (RGBQUAD array) and the bits - // (array of palette indices) from the DIB. + // Retrieve the color table (RGBQUAD array) and the bits + // (array of palette indices) from the DIB. if (!GetDIBits(hDC, hBMP, 0, (WORD) pbih->biHeight, lpBits, pbi, DIB_RGB_COLORS)) { NOTREACHED(); @@ -213,55 +208,54 @@ static BOOL BmpSaveFile(LPCTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, } } - // Create the bitmap file. - hf = CreateFile(pszFile, - GENERIC_READ | GENERIC_WRITE, - (DWORD) 0, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, + // Create the bitmap file. + hf = CreateFile(pszFile, + GENERIC_READ | GENERIC_WRITE, + (DWORD) 0, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, (HANDLE) NULL); if (hf == INVALID_HANDLE_VALUE) { // Could not create the bitmap file NOTREACHED(); goto end; } - - hdr.bfType = 0x4d42; // 0x42 = "B", 0x4d = "M" - - // Compute the size of the entire file. - hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + - pbih->biSize + pbih->biClrUsed - * sizeof(RGBQUAD) + pbih->biSizeImage); - hdr.bfReserved1 = 0; - hdr.bfReserved2 = 0; - // Compute the offset to the array of color indices. - hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + - pbih->biSize + pbih->biClrUsed - * sizeof (RGBQUAD); + hdr.bfType = 0x4d42; // 0x42 = "B", 0x4d = "M" - // Copy the BITMAPFILEHEADER into the bitmap file. - if (!WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), + // Compute the size of the entire file. + hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + + pbih->biSize + pbih->biClrUsed + * sizeof(RGBQUAD) + pbih->biSizeImage); + hdr.bfReserved1 = 0; + hdr.bfReserved2 = 0; + + // Compute the offset to the array of color indices. + hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + + pbih->biSize + pbih->biClrUsed * sizeof(RGBQUAD); + + // Copy the BITMAPFILEHEADER into the bitmap file. + if (!WriteFile(hf, (LPVOID) &hdr, sizeof(BITMAPFILEHEADER), (LPDWORD) &dwTmp, NULL)) { - // Could not write bitmap file header to file - NOTREACHED(); - goto end; - } - - // Copy the BITMAPINFOHEADER and RGBQUAD array into the file. - if (!WriteFile(hf, (LPVOID) pbih, sizeof(BITMAPINFOHEADER) - + pbih->biClrUsed * sizeof (RGBQUAD), - (LPDWORD) &dwTmp, NULL)) { - // Could not write bitmap info header to file + // Could not write bitmap file header to file NOTREACHED(); goto end; } - // Copy the array of color indices into the .BMP file. - dwTotal = cb = pbih->biSizeImage; - hp = lpBits; - if (!WriteFile(hf, (LPSTR) hp, (int) cb, (LPDWORD) &dwTmp,NULL)) { + // Copy the BITMAPINFOHEADER and RGBQUAD array into the file. + if (!WriteFile(hf, (LPVOID) pbih, sizeof(BITMAPINFOHEADER) + + pbih->biClrUsed * sizeof(RGBQUAD), + (LPDWORD) &dwTmp, NULL)) { + // Could not write bitmap info header to file + NOTREACHED(); + goto end; + } + + // Copy the array of color indices into the .BMP file. + dwTotal = cb = pbih->biSizeImage; + hp = lpBits; + if (!WriteFile(hf, (LPSTR) hp, (DWORD) cb, (LPDWORD) &dwTmp, NULL)) { // Could not write bitmap data to file NOTREACHED(); goto end; @@ -269,32 +263,30 @@ static BOOL BmpSaveFile(LPCTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, ret = TRUE; -end: - // Close the bitmap file. - if(hf != INVALID_HANDLE_VALUE) { +end: // NOLINT(whitespace/labels) + // Close the bitmap file. + if (hf != INVALID_HANDLE_VALUE) { CloseHandle(hf); - if(!ret) + if (!ret) DeleteFile(pszFile); } - if(bitsAlloc) - { - // Free memory. + if (bitsAlloc) { + // Free memory. GlobalFree((HGLOBAL)lpBits); } return ret; } -BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits) -{ +BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits) { PBITMAPINFO pbmi = BmpCreateInfo(hBmp); BOOL ret = FALSE; - if(pbmi) { + if (pbmi) { ret = BmpSaveFile(file, pbmi, hBmp, hDC, lpBits); LocalFree(pbmi); } return ret; } -} // namespace webkit_glue \ No newline at end of file +} // namespace webkit_glue diff --git a/libcef/browser_webkit_init.cc b/libcef/browser_webkit_init.cc index e2a88224c..527490179 100644 --- a/libcef/browser_webkit_init.cc +++ b/libcef/browser_webkit_init.cc @@ -3,12 +3,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webkit_init.h" -#include "browser_resource_loader_bridge.h" -#include "browser_socket_stream_bridge.h" -#include "browser_webkit_glue.h" -#include "browser_webstoragenamespace_impl.h" -#include "cef_context.h" +#include "libcef/browser_webkit_init.h" +#include "libcef/browser_resource_loader_bridge.h" +#include "libcef/browser_socket_stream_bridge.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/browser_webstoragenamespace_impl.h" +#include "libcef/cef_context.h" #include "base/metrics/stats_counters.h" #include "base/path_service.h" @@ -39,7 +39,7 @@ BrowserWebKitInit::BrowserWebKitInit() WebKit::WebRuntimeFeatures::enableIndexedDatabase(true); WebKit::WebRuntimeFeatures::enableFileSystem(true); - // TODO: Enable these once the implementation supports it. + // TODO(cef): Enable these once the implementation supports it. WebKit::WebRuntimeFeatures::enableNotifications(false); WebKit::WebRuntimeFeatures::enableGeolocation(false); WebKit::WebRuntimeFeatures::enableSpeechInput(false); @@ -123,29 +123,31 @@ int BrowserWebKitInit::databaseDeleteFile( vfs_file_name, sync_dir); } -long BrowserWebKitInit::databaseGetFileAttributes( +long BrowserWebKitInit::databaseGetFileAttributes( // NOLINT(runtime/int) const WebKit::WebString& vfs_file_name) { return BrowserDatabaseSystem::GetInstance()->GetFileAttributes( vfs_file_name); } -long long BrowserWebKitInit::databaseGetFileSize( +long long BrowserWebKitInit::databaseGetFileSize( // NOLINT(runtime/int) const WebKit::WebString& vfs_file_name) { return BrowserDatabaseSystem::GetInstance()->GetFileSize(vfs_file_name); } -long long BrowserWebKitInit::databaseGetSpaceAvailableForOrigin( +long long // NOLINT(runtime/int) +BrowserWebKitInit::databaseGetSpaceAvailableForOrigin( const WebKit::WebString& origin_identifier) { return BrowserDatabaseSystem::GetInstance()->GetSpaceAvailable( origin_identifier); } -unsigned long long BrowserWebKitInit::visitedLinkHash( +unsigned long long BrowserWebKitInit::visitedLinkHash( // NOLINT(runtime/int) const char* canonicalURL, size_t length) { return 0; } -bool BrowserWebKitInit::isLinkVisited(unsigned long long linkHash) { +bool BrowserWebKitInit::isLinkVisited( + unsigned long long linkHash) { // NOLINT(runtime/int) return false; } @@ -180,7 +182,7 @@ void BrowserWebKitInit::traceEventBegin(const char* name, void* id, const char* extra) { } -void BrowserWebKitInit::traceEventEnd(const char* name, void* id, +void BrowserWebKitInit::traceEventEnd(const char* name, void* id, const char* extra) { } diff --git a/libcef/browser_webkit_init.h b/libcef/browser_webkit_init.h index 16f939ce2..65882abdf 100644 --- a/libcef/browser_webkit_init.h +++ b/libcef/browser_webkit_init.h @@ -3,17 +3,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_WEBKIT_INIT_H -#define _BROWSER_WEBKIT_INIT_H +#ifndef CEF_LIBCEF_BROWSER_WEBKIT_INIT_H_ +#define CEF_LIBCEF_BROWSER_WEBKIT_INIT_H_ +#pragma once -#include "base/compiler_specific.h" +#include -#include "browser_appcache_system.h" -#include "browser_database_system.h" -#include "browser_file_system.h" -#include "browser_webblobregistry_impl.h" -#include "browser_webcookiejar_impl.h" -#include "simple_clipboard_impl.h" +#include "libcef/browser_appcache_system.h" +#include "libcef/browser_database_system.h" +#include "libcef/browser_file_system.h" +#include "libcef/browser_webblobregistry_impl.h" +#include "libcef/browser_webcookiejar_impl.h" +#include "libcef/simple_clipboard_impl.h" #include "base/scoped_temp_dir.h" #include "webkit/glue/simple_webmimeregistry_impl.h" @@ -21,7 +22,6 @@ #include "webkit/glue/webfileutilities_impl.h" #include "webkit/glue/webkitplatformsupport_impl.h" - class BrowserWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { public: BrowserWebKitInit(); @@ -33,33 +33,35 @@ class BrowserWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { virtual WebKit::WebSandboxSupport* sandboxSupport() OVERRIDE; virtual WebKit::WebBlobRegistry* blobRegistry() OVERRIDE; virtual WebKit::WebCookieJar* cookieJar() OVERRIDE; - virtual WebKit::WebFileSystem* fileSystem() OVERRIDE ; + virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; virtual bool sandboxEnabled() OVERRIDE; virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( const WebKit::WebString& vfs_file_name, int desired_flags) OVERRIDE; virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, bool sync_dir) OVERRIDE; - virtual long databaseGetFileAttributes( + virtual long databaseGetFileAttributes( // NOLINT(runtime/int) const WebKit::WebString& vfs_file_name) OVERRIDE; - virtual long long databaseGetFileSize( + virtual long long databaseGetFileSize( // NOLINT(runtime/int) const WebKit::WebString& vfs_file_name) OVERRIDE; - virtual long long databaseGetSpaceAvailableForOrigin( + virtual long long databaseGetSpaceAvailableForOrigin( // NOLINT(runtime/int) const WebKit::WebString& origin_identifier) OVERRIDE; - virtual unsigned long long visitedLinkHash(const char* canonicalURL, - size_t length) OVERRIDE; - virtual bool isLinkVisited(unsigned long long linkHash) OVERRIDE; + virtual unsigned long long visitedLinkHash( // NOLINT(runtime/int) + const char* canonicalURL, + size_t length) OVERRIDE; + virtual bool isLinkVisited( + unsigned long long linkHash) OVERRIDE; // NOLINT(runtime/int) virtual WebKit::WebMessagePortChannel* createMessagePortChannel() OVERRIDE; virtual void prefetchHostName(const WebKit::WebString&) OVERRIDE; virtual void decrementStatsCounter(const char* name) OVERRIDE; virtual void incrementStatsCounter(const char* name) OVERRIDE; - virtual void histogramCustomCounts(const char* name, int sample, int min, + virtual void histogramCustomCounts(const char* name, int sample, int min, int max, int bucket_count) OVERRIDE; virtual void histogramEnumeration(const char* name, int sample, int boundary_value) OVERRIDE; virtual bool isTraceEventEnabled() const OVERRIDE; virtual void traceEventBegin(const char* name, void* id, const char* extra) OVERRIDE; - virtual void traceEventEnd(const char* name, void* id, + virtual void traceEventEnd(const char* name, void* id, const char* extra) OVERRIDE; virtual WebKit::WebData loadResource(const char* name) OVERRIDE; virtual WebKit::WebString defaultLocale() OVERRIDE; @@ -111,4 +113,4 @@ class BrowserWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { scoped_refptr blob_registry_; }; -#endif // _BROWSER_WEBKIT_INIT_H +#endif // CEF_LIBCEF_BROWSER_WEBKIT_INIT_H_ diff --git a/libcef/browser_webstoragearea_impl.cc b/libcef/browser_webstoragearea_impl.cc index e23ec11bf..11f2235b5 100644 --- a/libcef/browser_webstoragearea_impl.cc +++ b/libcef/browser_webstoragearea_impl.cc @@ -2,10 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "browser_webstoragearea_impl.h" -#include "cef_context.h" -#include "dom_storage_area.h" -#include "dom_storage_namespace.h" +#include "libcef/browser_webstoragearea_impl.h" +#include "libcef/cef_context.h" +#include "libcef/dom_storage_area.h" +#include "libcef/dom_storage_namespace.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" diff --git a/libcef/browser_webstoragearea_impl.h b/libcef/browser_webstoragearea_impl.h index cf7127336..961f3b590 100644 --- a/libcef/browser_webstoragearea_impl.h +++ b/libcef/browser_webstoragearea_impl.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#ifndef _BROWSER_WEBSTORAGEAREA_IMPL_H -#define _BROWSER_WEBSTORAGEAREA_IMPL_H +#ifndef CEF_LIBCEF_BROWSER_WEBSTORAGEAREA_IMPL_H_ +#define CEF_LIBCEF_BROWSER_WEBSTORAGEAREA_IMPL_H_ +#pragma once #include "base/basictypes.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" @@ -13,7 +14,8 @@ class DOMStorageArea; class BrowserWebStorageAreaImpl : public WebKit::WebStorageArea { public: - BrowserWebStorageAreaImpl(int64 namespace_id, const WebKit::WebString& origin); + BrowserWebStorageAreaImpl(int64 namespace_id, + const WebKit::WebString& origin); virtual ~BrowserWebStorageAreaImpl(); // See WebStorageArea.h for documentation on these functions. @@ -34,4 +36,4 @@ class BrowserWebStorageAreaImpl : public WebKit::WebStorageArea { DOMStorageArea* area_; }; -#endif // _BROWSER_WEBSTORAGEAREA_IMPL_H +#endif // CEF_LIBCEF_BROWSER_WEBSTORAGEAREA_IMPL_H_ diff --git a/libcef/browser_webstoragenamespace_impl.cc b/libcef/browser_webstoragenamespace_impl.cc index da01ddca6..5a8d5314a 100644 --- a/libcef/browser_webstoragenamespace_impl.cc +++ b/libcef/browser_webstoragenamespace_impl.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webstoragenamespace_impl.h" -#include "browser_webstoragearea_impl.h" -#include "cef_context.h" +#include "libcef/browser_webstoragenamespace_impl.h" +#include "libcef/browser_webstoragearea_impl.h" +#include "libcef/cef_context.h" #include "base/logging.h" diff --git a/libcef/browser_webstoragenamespace_impl.h b/libcef/browser_webstoragenamespace_impl.h index c956db2e8..03aaa85db 100644 --- a/libcef/browser_webstoragenamespace_impl.h +++ b/libcef/browser_webstoragenamespace_impl.h @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _BROWSER_WEBSTORAGENAMESPACE_IMPL_H -#define _BROWSER_WEBSTORAGENAMESPACE_IMPL_H +#ifndef CEF_LIBCEF_BROWSER_WEBSTORAGENAMESPACE_IMPL_H_ +#define CEF_LIBCEF_BROWSER_WEBSTORAGENAMESPACE_IMPL_H_ +#pragma once -#include "dom_storage_common.h" +#include "libcef/dom_storage_common.h" #include "base/basictypes.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h" @@ -31,4 +32,4 @@ class BrowserWebStorageNamespaceImpl : public WebKit::WebStorageNamespace { int64 namespace_id_; }; -#endif // _BROWSER_WEBSTORAGENAMESPACE_IMPL_H +#endif // CEF_LIBCEF_BROWSER_WEBSTORAGENAMESPACE_IMPL_H_ diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index e192f71b3..d762b2c68 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -7,19 +7,19 @@ // as the WebViewDelegate for the BrowserWebHost. The host is expected to // have initialized a MessageLoop before these methods are called. -#include "browser_webview_delegate.h" -#include "browser_appcache_system.h" -#include "browser_file_system.h" -#include "browser_impl.h" -#include "browser_navigation_controller.h" -#include "browser_webkit_glue.h" -#include "browser_webstoragenamespace_impl.h" -#include "browser_zoom_map.h" -#include "cef_context.h" -#include "cef_process_ui_thread.h" -#include "dom_document_impl.h" -#include "request_impl.h" -#include "v8_impl.h" +#include "libcef/browser_webview_delegate.h" +#include "libcef/browser_appcache_system.h" +#include "libcef/browser_file_system.h" +#include "libcef/browser_impl.h" +#include "libcef/browser_navigation_controller.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/browser_webstoragenamespace_impl.h" +#include "libcef/browser_zoom_map.h" +#include "libcef/cef_context.h" +#include "libcef/cef_process_ui_thread.h" +#include "libcef/dom_document_impl.h" +#include "libcef/request_impl.h" +#include "libcef/v8_impl.h" #include "base/debug/trace_event.h" #include "base/file_util.h" @@ -73,8 +73,8 @@ #include "webkit/plugins/npapi/webplugin_impl.h" #if defined(OS_WIN) -#include "browser_drag_delegate_win.h" -#include "web_drop_target_win.h" +#include "libcef/browser_drag_delegate_win.h" +#include "libcef/web_drop_target_win.h" #endif using appcache::WebApplicationCacheHostImpl; @@ -125,8 +125,7 @@ namespace { int next_page_id_ = 1; void TranslatePopupFeatures(const WebWindowFeatures& webKitFeatures, - CefPopupFeatures& features) -{ + CefPopupFeatures& features) { features.x = static_cast(webKitFeatures.x); features.xSet = webKitFeatures.xSet; features.y = static_cast(webKitFeatures.y); @@ -144,13 +143,13 @@ void TranslatePopupFeatures(const WebWindowFeatures& webKitFeatures, features.resizable = webKitFeatures.resizable; features.fullscreen = webKitFeatures.fullscreen; - features.dialog = webKitFeatures.dialog; + features.dialog = webKitFeatures.dialog; features.additionalFeatures = NULL; - if (webKitFeatures.additionalFeatures.size() > 0) + if (webKitFeatures.additionalFeatures.size() > 0) features.additionalFeatures = cef_string_list_alloc(); CefString str; - for(unsigned int i = 0; i < webKitFeatures.additionalFeatures.size(); ++i) { + for (unsigned int i = 0; i < webKitFeatures.additionalFeatures.size(); ++i) { str = string16(webKitFeatures.additionalFeatures[i]); cef_string_list_append(features.additionalFeatures, str.GetStruct()); } @@ -202,7 +201,7 @@ void BrowserWebViewDelegate::didAddMessageToConsole( } } - if(!handled) { + if (!handled) { logging::LogMessage("CONSOLE", 0).stream() << "\"" << messageStr << ",\" source: " @@ -290,8 +289,8 @@ bool BrowserWebViewDelegate::runFileChooser( WebKit::WebFileChooserCompletion* chooser_completion) { // Support file open dialog. std::vector file_names; - - if(!ShowFileChooser(file_names, params.multiSelect, params.title, + + if (!ShowFileChooser(file_names, params.multiSelect, params.title, webkit_glue::WebStringToFilePath(params.initialValue))) { return false; } @@ -310,7 +309,7 @@ void BrowserWebViewDelegate::runModalAlertDialog( WebFrame* frame, const WebString& message) { CefString messageStr = string16(message); bool handled = false; - + CefRefPtr client = browser_->GetClient(); CefRefPtr handler; if (client.get()) @@ -329,7 +328,7 @@ bool BrowserWebViewDelegate::runModalConfirmDialog( CefString messageStr = string16(message); bool retval = false; bool handled = false; - + CefRefPtr client = browser_->GetClient(); CefRefPtr handler; if (client.get()) @@ -350,12 +349,12 @@ bool BrowserWebViewDelegate::runModalPromptDialog( CefString messageStr = string16(message); CefString defaultValueStr = string16(default_value); CefString actualValueStr; - if(actual_value) + if (actual_value) actualValueStr = string16(*actual_value); bool retval = false; bool handled = false; - + CefRefPtr client = browser_->GetClient(); CefRefPtr handler; if (client.get()) @@ -371,7 +370,7 @@ bool BrowserWebViewDelegate::runModalPromptDialog( } if (actual_value) *actual_value = string16(actualValueStr); - + return retval; } @@ -393,8 +392,7 @@ void BrowserWebViewDelegate::setKeyboardFocusURL(const WebKit::WebURL& url) { } void BrowserWebViewDelegate::setToolTipText( - const WebString& text, WebTextDirection hint) -{ + const WebString& text, WebTextDirection hint) { CefString tooltipStr = string16(text); bool handled = false; CefRefPtr client = browser_->GetClient(); @@ -597,7 +595,7 @@ WebPlugin* BrowserWebViewDelegate::createPlugin( NULL, &plugins, &mime_types); if (plugins.empty()) return NULL; - + #if defined(OS_MACOSX) // Mac does not supported windowed plugins. bool force_windowless = true; @@ -711,7 +709,7 @@ WebNavigationPolicy BrowserWebViewDelegate::decidePolicyForNavigation( req->SetMethod(string16(request.httpMethod())); const WebKit::WebHTTPBody& httpBody = request.httpBody(); - if(!httpBody.isNull()) { + if (!httpBody.isNull()) { CefRefPtr postdata(CefPostData::CreatePostData()); static_cast(postdata.get())->Set(httpBody); req->SetPostData(postdata); @@ -719,7 +717,7 @@ WebNavigationPolicy BrowserWebViewDelegate::decidePolicyForNavigation( CefRequest::HeaderMap map; CefRequestImpl::GetHeaderMap(request, map); - if(map.size() > 0) + if (map.size() > 0) static_cast(req.get())->SetHeaderMap(map); cef_handler_navtype_t navType; @@ -732,7 +730,7 @@ WebNavigationPolicy BrowserWebViewDelegate::decidePolicyForNavigation( bool handled = handler->OnBeforeBrowse(browser_, browser_->UIT_GetCefFrame(frame), req, navType, is_redirect); - if(handled) + if (handled) return WebKit::WebNavigationPolicyIgnore; } } @@ -792,7 +790,7 @@ void BrowserWebViewDelegate::didFailProvisionalLoad( const WebDataSource* failed_ds = frame->provisionalDataSource(); BrowserExtraData* extra_data = static_cast(failed_ds->extraData()); - + if (extra_data && !extra_data->request_committed) { // Set the pending extra_data for our error page as the same pending_page_id // to keep the history from getting messed up. @@ -803,7 +801,7 @@ void BrowserWebViewDelegate::didFailProvisionalLoad( CefString errorStr; bool handled = false; - + CefRefPtr client = browser_->GetClient(); if (client.get()) { CefRefPtr handler = client->GetLoadHandler(); @@ -815,8 +813,8 @@ void BrowserWebViewDelegate::didFailProvisionalLoad( std::string(failed_ds->request().url().spec().data()), errorStr); } } - - if(handled && !errorStr.empty()) { + + if (handled && !errorStr.empty()) { error_text = errorStr; } else { error_text = base::StringPrintf("Error %d when loading url %s", @@ -959,22 +957,22 @@ void BrowserWebViewDelegate::didChangeContentsSize( } void BrowserWebViewDelegate::reportFindInPageMatchCount( - int request_id, int count, bool final_update) -{ + int request_id, int count, bool final_update) { browser_->UIT_NotifyFindStatus(request_id, count, gfx::Rect(), -1, // Don't update active match ordinal. final_update); } void BrowserWebViewDelegate::reportFindInPageSelection( - int request_id, int active_match_ordinal, const WebKit::WebRect& sel) -{ + int request_id, int active_match_ordinal, const WebKit::WebRect& sel) { browser_->UIT_NotifyFindStatus(request_id, -1, sel, active_match_ordinal, false); } void BrowserWebViewDelegate::openFileSystem( - WebFrame* frame, WebFileSystem::Type type, long long size, bool create, + WebFrame* frame, WebFileSystem::Type type, + long long size, // NOLINT(runtime/int) + bool create, WebFileSystemCallbacks* callbacks) { BrowserFileSystem* fileSystem = static_cast( WebKit::webKitPlatformSupport()->fileSystem()); @@ -1006,7 +1004,7 @@ void BrowserWebViewDelegate::Reset() { // Do a little placement new dance... CefBrowserImpl* browser = browser_; this->~BrowserWebViewDelegate(); - new (this) BrowserWebViewDelegate(browser); + new (this)BrowserWebViewDelegate(browser); // NOLINT(whitespace/parens) } void BrowserWebViewDelegate::SetSmartInsertDeleteEnabled(bool enabled) { @@ -1037,8 +1035,7 @@ void BrowserWebViewDelegate::WaitForPolicyDelegate() { // Private methods ----------------------------------------------------------- bool BrowserWebViewDelegate::OnKeyboardEvent( - const WebKit::WebKeyboardEvent& event, bool isAfterJavaScript) -{ + const WebKit::WebKeyboardEvent& event, bool isAfterJavaScript) { CefRefPtr client = browser_->GetClient(); CefRefPtr handler; if (client.get()) @@ -1048,10 +1045,10 @@ bool BrowserWebViewDelegate::OnKeyboardEvent( CefKeyboardHandler::KeyEventType eventType; switch (event.type) { - case WebKeyboardEvent::RawKeyDown: + case WebKeyboardEvent::RawKeyDown: eventType = KEYEVENT_RAWKEYDOWN; break; - case WebKeyboardEvent::KeyDown: + case WebKeyboardEvent::KeyDown: eventType = KEYEVENT_KEYDOWN; break; case WebKeyboardEvent::KeyUp: @@ -1069,8 +1066,7 @@ bool BrowserWebViewDelegate::OnKeyboardEvent( } void BrowserWebViewDelegate::ShowStatus(const WebString& text, - cef_handler_statustype_t type) -{ + cef_handler_statustype_t type) { CefRefPtr client = browser_->GetClient(); if (client.get()) { CefRefPtr handler = client->GetDisplayHandler(); @@ -1085,7 +1081,7 @@ void BrowserWebViewDelegate::LocationChangeDone(WebFrame* frame) { CefRefPtr client = browser_->GetClient(); if (!client.get()) return; - + bool is_main_frame = (frame->parent() == 0); if (is_main_frame) { CefString title = browser_->UIT_GetTitle(); @@ -1213,7 +1209,7 @@ void BrowserWebViewDelegate::UpdateSessionHistory(WebFrame* frame) { return; WebView* view = browser_->UIT_GetWebView(); - if (!view) + if (!view) return; const WebHistoryItem& history_item = view->mainFrame()->previousHistoryItem(); @@ -1228,30 +1224,30 @@ bool BrowserWebViewDelegate::OnBeforeMenu( int& edit_flags, int& type_flags) { // Populate the edit flags values. edit_flags = data.editFlags; - if(browser_->UIT_CanGoBack()) + if (browser_->UIT_CanGoBack()) edit_flags |= MENU_CAN_GO_BACK; - if(browser_->UIT_CanGoForward()) + if (browser_->UIT_CanGoForward()) edit_flags |= MENU_CAN_GO_FORWARD; // Populate the type flags values. type_flags = MENUTYPE_NONE; - if(!data.pageURL.isEmpty()) + if (!data.pageURL.isEmpty()) type_flags |= MENUTYPE_PAGE; - if(!data.frameURL.isEmpty()) + if (!data.frameURL.isEmpty()) type_flags |= MENUTYPE_FRAME; - if(!data.linkURL.isEmpty()) + if (!data.linkURL.isEmpty()) type_flags |= MENUTYPE_LINK; - if(data.mediaType == WebContextMenuData::MediaTypeImage) + if (data.mediaType == WebContextMenuData::MediaTypeImage) type_flags |= MENUTYPE_IMAGE; - if(!data.selectedText.isEmpty()) + if (!data.selectedText.isEmpty()) type_flags |= MENUTYPE_SELECTION; - if(data.isEditable) + if (data.isEditable) type_flags |= MENUTYPE_EDITABLE; - if(data.isSpellCheckingEnabled && !data.misspelledWord.isEmpty()) + if (data.isSpellCheckingEnabled && !data.misspelledWord.isEmpty()) type_flags |= MENUTYPE_MISSPELLED_WORD; - if(data.mediaType == WebContextMenuData::MediaTypeVideo) + if (data.mediaType == WebContextMenuData::MediaTypeVideo) type_flags |= MENUTYPE_VIDEO; - if(data.mediaType == WebContextMenuData::MediaTypeAudio) + if (data.mediaType == WebContextMenuData::MediaTypeAudio) type_flags |= MENUTYPE_AUDIO; CefRefPtr client = browser_->GetClient(); @@ -1292,6 +1288,6 @@ bool BrowserWebViewDelegate::OnBeforeMenu( if (handler->OnBeforeMenu(browser_, menuInfo)) return true; } - + return false; } diff --git a/libcef/browser_webview_delegate.h b/libcef/browser_webview_delegate.h index eddc4f56a..3daf51bf2 100644 --- a/libcef/browser_webview_delegate.h +++ b/libcef/browser_webview_delegate.h @@ -3,17 +3,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// BrowserWebViewDelegate class: +// BrowserWebViewDelegate class: // This class implements the WebViewDelegate methods for the test shell. One // instance is owned by each CefBrowser. -#ifndef _BROWSER_WEBVIEW_DELEGATE_H -#define _BROWSER_WEBVIEW_DELEGATE_H - +#ifndef CEF_LIBCEF_BROWSER_WEBVIEW_DELEGATE_H_ +#define CEF_LIBCEF_BROWSER_WEBVIEW_DELEGATE_H_ +#pragma once #include +#include +#include + +#include "libcef/browser_navigation_controller.h" #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" @@ -26,11 +31,14 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h" #include "webkit/glue/webcursor.h" #include "webkit/plugins/npapi/webplugin_page_delegate.h" -#include "browser_navigation_controller.h" + +#if defined(TOOLKIT_USES_GTK) +#include // NOLINT(build/include_order) +#endif #if defined(OS_MACOSX) #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" -#include "external_popup_menu_mac.h" +#include "libcef/external_popup_menu_mac.h" #endif #if defined(OS_WIN) @@ -38,10 +46,6 @@ class BrowserDragDelegate; class WebDropTarget; #endif -#if defined(TOOLKIT_USES_GTK) -#include -#endif - class CefBrowserImpl; class GURL; class WebWidgetHost; @@ -193,7 +197,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, virtual void openFileSystem( WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, - long long size, + long long size, // NOLINT(runtime/int) bool create, WebKit::WebFileSystemCallbacks* callbacks) OVERRIDE; @@ -287,9 +291,9 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, CefString* result); // Called to show the file chooser dialog. - bool ShowFileChooser(std::vector& file_names, - const bool multi_select, - const WebKit::WebString& title, + bool ShowFileChooser(std::vector& file_names, + const bool multi_select, + const WebKit::WebString& title, const FilePath& default_file); // Called to show status messages. @@ -314,7 +318,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, int& type_flags); private: - // Causes navigation actions just printout the intended navigation instead + // Causes navigation actions just printout the intended navigation instead // of taking you to the page. This is used for cases like mailto, where you // don't actually want to open the mail program. bool policy_delegate_enabled_; @@ -370,4 +374,4 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient, DISALLOW_COPY_AND_ASSIGN(BrowserWebViewDelegate); }; -#endif // _BROWSER_WEBVIEW_DELEGATE_H +#endif // CEF_LIBCEF_BROWSER_WEBVIEW_DELEGATE_H_ diff --git a/libcef/browser_webview_delegate_gtk.cc b/libcef/browser_webview_delegate_gtk.cc index 8a6e948f0..b4a44cb66 100644 --- a/libcef/browser_webview_delegate_gtk.cc +++ b/libcef/browser_webview_delegate_gtk.cc @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webview_delegate.h" -#include "browser_impl.h" - -#include -#include +#include "libcef/browser_webview_delegate.h" +#include "libcef/browser_impl.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -32,7 +29,9 @@ #include "webkit/plugins/npapi/webplugin.h" #include "webkit/plugins/npapi/webplugin_delegate_impl.h" -#include "include/internal/cef_types.h" +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) + using webkit::npapi::WebPluginDelegateImpl; using WebKit::WebContextMenuData; @@ -103,12 +102,12 @@ WebKit::WebExternalPopupMenu* BrowserWebViewDelegate::createExternalPopupMenu( return NULL; } -static gboolean MenuItemHandle(GtkWidget* menu_item, gpointer data) -{ +static gboolean MenuItemHandle(GtkWidget* menu_item, gpointer data) { if (!data) return FALSE; - BrowserWebViewDelegate* webViewDelegate = (BrowserWebViewDelegate*)data; + BrowserWebViewDelegate* webViewDelegate = + reinterpret_cast(data); int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item), "menu_id")); webViewDelegate->HandleContextMenu(id); @@ -117,8 +116,7 @@ static gboolean MenuItemHandle(GtkWidget* menu_item, gpointer data) } static GtkWidget* MenuItemCreate(GtkWidget* parent_menu, const char* name, - int id, bool is_enabled, BrowserWebViewDelegate* webViewDelegate) -{ + int id, bool is_enabled, BrowserWebViewDelegate* webViewDelegate) { GtkWidget* menu_item = gtk_menu_item_new_with_label(name); g_object_set_data(G_OBJECT(menu_item), "menu_id", @@ -133,8 +131,7 @@ static GtkWidget* MenuItemCreate(GtkWidget* parent_menu, const char* name, return menu_item; } -static GtkWidget* MenuItemCreateSeperator(GtkWidget* parent_menu) -{ +static GtkWidget* MenuItemCreateSeperator(GtkWidget* parent_menu) { GtkWidget* menu_item = gtk_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(parent_menu), menu_item); @@ -181,11 +178,11 @@ void BrowserWebViewDelegate::showContextMenu(WebKit::WebFrame* frame, MenuItemCreateSeperator(menu); MenuItemCreate(menu, "Select All", MENU_ID_SELECTALL, !!(edit_flags & MENU_CAN_SELECT_ALL), this); - } else if(type_flags & MENUTYPE_SELECTION) { + } else if (type_flags & MENUTYPE_SELECTION) { menu = gtk_menu_new(); MenuItemCreate(menu, "Copy", MENU_ID_COPY, !!(edit_flags & MENU_CAN_COPY), this); - } else if(type_flags & (MENUTYPE_PAGE | MENUTYPE_FRAME)) { + } else if (type_flags & (MENUTYPE_PAGE | MENUTYPE_FRAME)) { menu = gtk_menu_new(); MenuItemCreate(menu, "Back", MENU_ID_NAV_BACK, !!(edit_flags & MENU_CAN_GO_BACK), this); @@ -336,8 +333,7 @@ void BrowserWebViewDelegate::DidMovePlugin( plugin_container_manager->MovePluginContainer(move); } -void BrowserWebViewDelegate::HandleContextMenu(int selected_id) -{ +void BrowserWebViewDelegate::HandleContextMenu(int selected_id) { if (selected_id != 0) { CefRefPtr client = browser_->GetClient(); CefRefPtr handler; @@ -352,7 +348,7 @@ void BrowserWebViewDelegate::HandleContextMenu(int selected_id) handled = handler->OnMenuAction(browser_, menuId); } - if(!handled) { + if (!handled) { // Execute the action browser_->UIT_HandleAction(menuId, browser_->GetFocusedFrame()); } diff --git a/libcef/browser_webview_delegate_mac.mm b/libcef/browser_webview_delegate_mac.mm index 1338487fc..170c80f51 100644 --- a/libcef/browser_webview_delegate_mac.mm +++ b/libcef/browser_webview_delegate_mac.mm @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webview_delegate.h" -#import "browser_webview_mac.h" -#include "browser_impl.h" -#include "drag_data_impl.h" +#include "libcef/browser_webview_delegate.h" +#import "libcef/browser_webview_mac.h" +#include "libcef/browser_impl.h" +#include "libcef/drag_data_impl.h" #import "include/cef_application_mac.h" #import diff --git a/libcef/browser_webview_delegate_win.cc b/libcef/browser_webview_delegate_win.cc index 47bf3617f..c98ec8788 100644 --- a/libcef/browser_webview_delegate_win.cc +++ b/libcef/browser_webview_delegate_win.cc @@ -7,18 +7,19 @@ // as the WebViewDelegate for the BrowserWebHost. The host is expected to // have initialized a MessageLoop before these methods are called. -#include "browser_drag_delegate_win.h" -#include "browser_navigation_controller.h" -#include "browser_impl.h" -#include "browser_webview_delegate.h" -#include "cef_context.h" -#include "drag_data_impl.h" -#include "web_drop_target_win.h" +#include "libcef/browser_webview_delegate.h" #include #include #include +#include "libcef/browser_drag_delegate_win.h" +#include "libcef/browser_navigation_controller.h" +#include "libcef/browser_impl.h" +#include "libcef/cef_context.h" +#include "libcef/drag_data_impl.h" +#include "libcef/web_drop_target_win.h" + #include "base/message_loop.h" #include "base/string_util.h" #include "net/base/net_errors.h" @@ -66,8 +67,7 @@ void AddMenuItem(CefRefPtr browser, cef_menu_id_t menuId, const wchar_t* label, bool enabled, - std::list& label_list) -{ + std::list& label_list) { CefString actual_label(label); if (handler.get()) { // Let the handler change the label if desired, @@ -91,8 +91,7 @@ void AddMenuItem(CefRefPtr browser, InsertMenuItem(menu, -1, TRUE, &mii); } -void AddMenuSeparator(HMENU menu) -{ +void AddMenuSeparator(HMENU menu) { MENUITEMINFO mii; mii.cbSize = sizeof(mii); mii.fMask = MIIM_FTYPE; @@ -101,7 +100,7 @@ void AddMenuSeparator(HMENU menu) InsertMenuItem(menu, -1, TRUE, &mii); } -} // namespace +} // namespace // WebViewClient -------------------------------------------------------------- @@ -120,7 +119,7 @@ void BrowserWebViewDelegate::show(WebNavigationPolicy) { // Restore the window and bring it to the top if the window is currently // visible. HWND root = GetAncestor(browser_->UIT_GetMainWndHandle(), GA_ROOT); - if(IsWindowVisible(root)) { + if (IsWindowVisible(root)) { ShowWindow(root, SW_SHOWNORMAL); SetWindowPos(root, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); } @@ -145,7 +144,7 @@ void BrowserWebViewDelegate::didChangeCursor(const WebCursorInfo& cursor_info) { if (WebWidgetHost* host = GetWidgetHost()) { current_cursor_.InitFromCursorInfo(cursor_info); HMODULE hModule = ::GetModuleHandle(L"libcef.dll"); - if(!hModule) + if (!hModule) hModule = ::GetModuleHandle(NULL); HCURSOR hCursor = current_cursor_.GetCursor(hModule); @@ -195,7 +194,7 @@ void BrowserWebViewDelegate::setWindowRect(const WebRect& rect) { } else { browser_->set_popup_rect(rect); browser_->UIT_GetPopupHost()->SetSize(rect.width, rect.height); - + // Notify the handler of popup size change. CefRefPtr client = browser_->GetClient(); if (client.get()) { @@ -268,9 +267,9 @@ void BrowserWebViewDelegate::runModal() { CefRefPtr client = browser_->GetClient(); CefRefPtr handler; - if( client.get()) + if (client.get()) handler = client->GetLifeSpanHandler(); - + bool handled(false); if (handler.get()) { @@ -293,7 +292,7 @@ void BrowserWebViewDelegate::runModal() { } DWORD dwStyle = ::GetWindowLong(child, GWL_STYLE); DWORD dwNewStyle = dwStyle | WS_POPUP; - if(dwStyle != dwNewStyle) + if (dwStyle != dwNewStyle) ::SetWindowLong(child, GWL_STYLE, dwNewStyle); } @@ -313,8 +312,7 @@ void BrowserWebViewDelegate::runModal() { webkit::npapi::WebPluginDelegate* BrowserWebViewDelegate::CreatePluginDelegate( const FilePath& file_path, - const std::string& mime_type) -{ + const std::string& mime_type) { WebViewHost* host = browser_->UIT_GetWebViewHost(); if (!host) return NULL; @@ -379,7 +377,7 @@ void BrowserWebViewDelegate::WillDestroyPluginWindow( void BrowserWebViewDelegate::DidMovePlugin( const webkit::npapi::WebPluginGeometry& move) { - unsigned long flags = 0; + UINT flags = 0; if (move.rects_valid) { HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), @@ -417,10 +415,9 @@ void BrowserWebViewDelegate::DidMovePlugin( } void BrowserWebViewDelegate::showContextMenu( - WebFrame* frame, const WebContextMenuData& data) -{ + WebFrame* frame, const WebContextMenuData& data) { int screenX = -1, screenY = -1; - + POINT mouse_pt = {data.mousePosition.x, data.mousePosition.y}; if (!browser_->IsWindowRenderingDisabled()) { // Perform the conversion to screen coordinates only if window rendering is @@ -477,11 +474,11 @@ void BrowserWebViewDelegate::showContextMenu( AddMenuSeparator(menu); AddMenuItem(browser_, handler, menu, MENU_ID_SELECTALL, L"Select All", !!(edit_flags & MENU_CAN_SELECT_ALL), label_list); - } else if(type_flags & MENUTYPE_SELECTION) { + } else if (type_flags & MENUTYPE_SELECTION) { menu = CreatePopupMenu(); AddMenuItem(browser_, handler, menu, MENU_ID_COPY, L"Copy", !!(edit_flags & MENU_CAN_COPY), label_list); - } else if(type_flags & (MENUTYPE_PAGE | MENUTYPE_FRAME)) { + } else if (type_flags & (MENUTYPE_PAGE | MENUTYPE_FRAME)) { menu = CreatePopupMenu(); AddMenuItem(browser_, handler, menu, MENU_ID_NAV_BACK, L"Back", !!(edit_flags & MENU_CAN_GO_BACK), label_list); @@ -511,7 +508,7 @@ void BrowserWebViewDelegate::showContextMenu( handled = handler->OnMenuAction(browser_, menuId); } - if(!handled) { + if (!handled) { // Execute the action browser_->UIT_HandleAction(menuId, browser_->GetFocusedFrame()); } @@ -539,8 +536,7 @@ void BrowserWebViewDelegate::EndDragging() { } void BrowserWebViewDelegate::ShowJavaScriptAlert(WebFrame* webframe, - const CefString& message) -{ + const CefString& message) { // TODO(cef): Think about what we should be showing as the prompt caption std::wstring messageStr = message; std::wstring titleStr = browser_->UIT_GetTitle(); @@ -549,8 +545,7 @@ void BrowserWebViewDelegate::ShowJavaScriptAlert(WebFrame* webframe, } bool BrowserWebViewDelegate::ShowJavaScriptConfirm(WebFrame* webframe, - const CefString& message) -{ + const CefString& message) { // TODO(cef): Think about what we should be showing as the prompt caption std::wstring messageStr = message; std::wstring titleStr = browser_->UIT_GetTitle(); @@ -562,19 +557,16 @@ bool BrowserWebViewDelegate::ShowJavaScriptConfirm(WebFrame* webframe, bool BrowserWebViewDelegate::ShowJavaScriptPrompt(WebFrame* webframe, const CefString& message, const CefString& default_value, - CefString* result) -{ + CefString* result) { // TODO(cef): Implement a default prompt dialog return false; } -namespace -{ +namespace { // from chrome/browser/views/shell_dialogs_win.cc -bool RunOpenFileDialog(const std::wstring& filter, HWND owner, FilePath* path) -{ +bool RunOpenFileDialog(const std::wstring& filter, HWND owner, FilePath* path) { OPENFILENAME ofn; // We must do this otherwise the ofn's FlagsEx may be initialized to random @@ -603,8 +595,7 @@ bool RunOpenFileDialog(const std::wstring& filter, HWND owner, FilePath* path) } bool RunOpenMultiFileDialog(const std::wstring& filter, HWND owner, - std::vector* paths) -{ + std::vector* paths) { OPENFILENAME ofn; // We must do this otherwise the ofn's FlagsEx may be initialized to random @@ -655,15 +646,14 @@ bool RunOpenMultiFileDialog(const std::wstring& filter, HWND owner, return success; } -} +} // namespace -bool BrowserWebViewDelegate::ShowFileChooser(std::vector& file_names, - const bool multi_select, - const WebKit::WebString& title, - const FilePath& default_file) -{ +bool BrowserWebViewDelegate::ShowFileChooser(std::vector& file_names, + const bool multi_select, + const WebKit::WebString& title, + const FilePath& default_file) { bool result = false; - + if (multi_select) { result = RunOpenMultiFileDialog(L"", browser_->UIT_GetMainWndHandle(), &file_names); diff --git a/libcef/browser_webview_mac.h b/libcef/browser_webview_mac.h index 2abdf05ce..802aa140c 100644 --- a/libcef/browser_webview_mac.h +++ b/libcef/browser_webview_mac.h @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef CEF_LIBCEF_BROWSER_WEBVIEW_MAC_H_ +#define CEF_LIBCEF_BROWSER_WEBVIEW_MAC_H_ +#pragma once + #import #import "base/mac/cocoa_protocols.h" #include "base/memory/scoped_nsobject.h" @@ -16,8 +20,8 @@ struct WebDropData; @interface BrowserWebView : NSView { @private - CefBrowserImpl *browser_; // weak - NSTrackingArea *trackingArea_; + CefBrowserImpl* browser_; // weak + NSTrackingArea* trackingArea_; scoped_nsobject dragSource_; scoped_nsobject dropTarget_; @@ -53,6 +57,8 @@ struct WebDropData; image:(NSImage*)image offset:(NSPoint)offset; -@property (nonatomic, assign) CefBrowserImpl *browser; +@property (nonatomic, assign) CefBrowserImpl* browser; @end + +#endif // CEF_LIBCEF_BROWSER_WEBVIEW_MAC_H_ diff --git a/libcef/browser_webview_mac.mm b/libcef/browser_webview_mac.mm index 2a88c4207..9ccd98fa7 100644 --- a/libcef/browser_webview_mac.mm +++ b/libcef/browser_webview_mac.mm @@ -4,12 +4,12 @@ #import -#import "browser_webview_mac.h" -#import "browser_impl.h" -#import "cef_context.h" -#import "web_drag_source_mac.h" -#import "web_drop_target_mac.h" -#import "webwidget_host.h" +#import "libcef/browser_webview_mac.h" +#import "libcef/browser_impl.h" +#import "libcef/cef_context.h" +#import "libcef/web_drag_source_mac.h" +#import "libcef/web_drop_target_mac.h" +#import "libcef/webwidget_host.h" #import "base/memory/scoped_ptr.h" #import "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" diff --git a/libcef/browser_zoom_map.cc b/libcef/browser_zoom_map.cc index 8d2a208fb..2be915400 100644 --- a/libcef/browser_zoom_map.cc +++ b/libcef/browser_zoom_map.cc @@ -2,16 +2,14 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "browser_zoom_map.h" -#include "cef_thread.h" +#include "libcef/browser_zoom_map.h" +#include "libcef/cef_thread.h" -ZoomMap* ZoomMap::GetInstance() -{ +ZoomMap* ZoomMap::GetInstance() { return Singleton::get(); } -void ZoomMap::set(const GURL& url, double zoomLevel) -{ +void ZoomMap::set(const GURL& url, double zoomLevel) { REQUIRE_UIT(); if (zoomLevel == 0.) { @@ -25,8 +23,7 @@ void ZoomMap::set(const GURL& url, double zoomLevel) } } -bool ZoomMap::get(const GURL& url, double& zoomLevel) -{ +bool ZoomMap::get(const GURL& url, double& zoomLevel) { REQUIRE_UIT(); Map::const_iterator iter = map_.find(url.host()); diff --git a/libcef/browser_zoom_map.h b/libcef/browser_zoom_map.h index b36d4c387..5b4345d9a 100644 --- a/libcef/browser_zoom_map.h +++ b/libcef/browser_zoom_map.h @@ -2,22 +2,22 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#ifndef _BROWSER_ZOOM_MAP_H -#define _BROWSER_ZOOM_MAP_H +#ifndef CEF_LIBCEF_BROWSER_ZOOM_MAP_H_ +#define CEF_LIBCEF_BROWSER_ZOOM_MAP_H_ +#pragma once + +#include +#include #include "include/internal/cef_string.h" #include "base/memory/singleton.h" #include "googleurl/src/gurl.h" -#include -#include - // Maps the host/domain of a URL to a zoom value. // NOTE: This class is not thread-safe. It is assumed that the methods will be // called from the UI thread. -class ZoomMap -{ -public: +class ZoomMap { + public: // Returns the static ZoomMap instance. static ZoomMap* GetInstance(); @@ -28,7 +28,7 @@ public: // |zoomLevel| is the "out" variable. bool get(const GURL& url, double& zoomLevel); -private: + private: typedef std::map Map; Map map_; @@ -40,4 +40,4 @@ private: DISALLOW_COPY_AND_ASSIGN(ZoomMap); }; -#endif // _BROWSER_ZOOM_MAP_H +#endif // CEF_LIBCEF_BROWSER_ZOOM_MAP_H_ diff --git a/libcef/cef_context.cc b/libcef/cef_context.cc index 9b859dd1d..a9748f3e0 100644 --- a/libcef/cef_context.cc +++ b/libcef/cef_context.cc @@ -2,10 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "cef_context.h" -#include "browser_devtools_scheme_handler.h" -#include "browser_impl.h" -#include "browser_webkit_glue.h" +#include "libcef/cef_context.h" +#include "libcef/browser_devtools_scheme_handler.h" +#include "libcef/browser_impl.h" +#include "libcef/browser_webkit_glue.h" #include "base/bind.h" #include "base/file_util.h" @@ -26,28 +26,26 @@ namespace { // Used in multi-threaded message loop mode to observe shutdown of the UI // thread. -class DestructionObserver : public MessageLoop::DestructionObserver -{ -public: - DestructionObserver(base::WaitableEvent *event) : event_(event) {} +class DestructionObserver : public MessageLoop::DestructionObserver { + public: + explicit DestructionObserver(base::WaitableEvent *event) : event_(event) {} virtual void WillDestroyCurrentMessageLoop() { MessageLoop::current()->RemoveDestructionObserver(this); event_->Signal(); delete this; } -private: + private: base::WaitableEvent *event_; }; -} // anonymous +} // namespace -bool CefInitialize(const CefSettings& settings, CefRefPtr application) -{ +bool CefInitialize(const CefSettings& settings, CefRefPtr application) { // Return true if the global context already exists. - if(_Context.get()) + if (_Context.get()) return true; - if(settings.size != sizeof(cef_settings_t)) { + if (settings.size != sizeof(cef_settings_t)) { NOTREACHED() << "invalid CefSettings structure size"; return false; } @@ -59,8 +57,7 @@ bool CefInitialize(const CefSettings& settings, CefRefPtr application) return _Context->Initialize(settings, application); } -void CefShutdown() -{ +void CefShutdown() { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -68,7 +65,7 @@ void CefShutdown() } // Must always be called on the same thread as Initialize. - if(!_Context->process()->CalledOnValidThread()) { + if (!_Context->process()->CalledOnValidThread()) { NOTREACHED() << "called on invalid thread"; return; } @@ -80,8 +77,7 @@ void CefShutdown() _Context = NULL; } -void CefDoMessageLoopWork() -{ +void CefDoMessageLoopWork() { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -89,7 +85,7 @@ void CefDoMessageLoopWork() } // Must always be called on the same thread as Initialize. - if(!_Context->process()->CalledOnValidThread()) { + if (!_Context->process()->CalledOnValidThread()) { NOTREACHED() << "called on invalid thread"; return; } @@ -97,8 +93,7 @@ void CefDoMessageLoopWork() _Context->process()->DoMessageLoopIteration(); } -void CefRunMessageLoop() -{ +void CefRunMessageLoop() { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -106,7 +101,7 @@ void CefRunMessageLoop() } // Must always be called on the same thread as Initialize. - if(!_Context->process()->CalledOnValidThread()) { + if (!_Context->process()->CalledOnValidThread()) { NOTREACHED() << "called on invalid thread"; return; } @@ -114,8 +109,7 @@ void CefRunMessageLoop() _Context->process()->RunMessageLoop(); } -void CefQuitMessageLoop() -{ +void CefQuitMessageLoop() { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -123,7 +117,7 @@ void CefQuitMessageLoop() } // Must always be called on the same thread as Initialize. - if(!_Context->process()->CalledOnValidThread()) { + if (!_Context->process()->CalledOnValidThread()) { NOTREACHED() << "called on invalid thread"; return; } @@ -138,19 +132,16 @@ CefContext::CefContext() : initialized_(false), shutting_down_(false), next_browser_id_(kNextBrowserIdReset), - current_webviewhost_(NULL) -{ + current_webviewhost_(NULL) { } -CefContext::~CefContext() -{ - if(!shutting_down_) +CefContext::~CefContext() { + if (!shutting_down_) Shutdown(); } bool CefContext::Initialize(const CefSettings& settings, - CefRefPtr application) -{ + CefRefPtr application) { settings_ = settings; application_ = application; @@ -173,14 +164,13 @@ bool CefContext::Initialize(const CefSettings& settings, return true; } -void CefContext::Shutdown() -{ +void CefContext::Shutdown() { // Must always be called on the same thread as Initialize. DCHECK(process_->CalledOnValidThread()); - + shutting_down_ = true; - if(settings_.multi_threaded_message_loop) { + if (settings_.multi_threaded_message_loop) { // Events that will be used to signal when shutdown is complete. Start in // non-signaled mode so that the event will block. base::WaitableEvent browser_shutdown_event(false, false); @@ -208,23 +198,21 @@ void CefContext::Shutdown() } } -bool CefContext::AddBrowser(CefRefPtr browser) -{ +bool CefContext::AddBrowser(CefRefPtr browser) { bool found = false; - + AutoLock lock_scope(this); - + // check that the browser isn't already in the list before adding BrowserList::const_iterator it = browserlist_.begin(); - for(; it != browserlist_.end(); ++it) { - if(it->get() == browser.get()) { + for (; it != browserlist_.end(); ++it) { + if (it->get() == browser.get()) { found = true; break; } } - if(!found) - { + if (!found) { browser->UIT_SetUniqueID(next_browser_id_++); browserlist_.push_back(browser); } @@ -232,8 +220,7 @@ bool CefContext::AddBrowser(CefRefPtr browser) return !found; } -bool CefContext::RemoveBrowser(CefRefPtr browser) -{ +bool CefContext::RemoveBrowser(CefRefPtr browser) { bool deleted = false; bool empty = false; @@ -241,8 +228,8 @@ bool CefContext::RemoveBrowser(CefRefPtr browser) AutoLock lock_scope(this); BrowserList::iterator it = browserlist_.begin(); - for(; it != browserlist_.end(); ++it) { - if(it->get() == browser.get()) { + for (; it != browserlist_.end(); ++it) { + if (it->get() == browser.get()) { browserlist_.erase(it); deleted = true; break; @@ -267,21 +254,19 @@ bool CefContext::RemoveBrowser(CefRefPtr browser) return deleted; } -CefRefPtr CefContext::GetBrowserByID(int id) -{ +CefRefPtr CefContext::GetBrowserByID(int id) { AutoLock lock_scope(this); BrowserList::const_iterator it = browserlist_.begin(); - for(; it != browserlist_.end(); ++it) { - if(it->get()->UIT_GetUniqueID() == id) + for (; it != browserlist_.end(); ++it) { + if (it->get()->UIT_GetUniqueID() == id) return it->get(); } return NULL; } -std::string CefContext::locale() const -{ +std::string CefContext::locale() const { std::string localeStr = CefString(&settings_.locale); if (!localeStr.empty()) return localeStr; @@ -289,9 +274,9 @@ std::string CefContext::locale() const return "en-US"; } -void CefContext::UIT_FinishShutdown(base::WaitableEvent* browser_shutdown_event, - base::WaitableEvent* uithread_shutdown_event) -{ +void CefContext::UIT_FinishShutdown( + base::WaitableEvent* browser_shutdown_event, + base::WaitableEvent* uithread_shutdown_event) { DCHECK(CefThread::CurrentlyOn(CefThread::UI)); BrowserList list; @@ -307,7 +292,7 @@ void CefContext::UIT_FinishShutdown(base::WaitableEvent* browser_shutdown_event, // Destroy any remaining browser windows. if (!list.empty()) { BrowserList::iterator it = list.begin(); - for(; it != list.end(); ++it) + for (; it != list.end(); ++it) (*it)->UIT_DestroyBrowser(); } diff --git a/libcef/cef_context.h b/libcef/cef_context.h index ec9c19251..ea4c55adf 100644 --- a/libcef/cef_context.h +++ b/libcef/cef_context.h @@ -2,20 +2,24 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#ifndef _CEF_CONTEXT_H -#define _CEF_CONTEXT_H +#ifndef CEF_LIBCEF_CEF_CONTEXT_H_ +#define CEF_LIBCEF_CEF_CONTEXT_H_ +#pragma once + +#include +#include +#include #include "include/cef_app.h" #include "include/cef_base.h" -#include "browser_file_system.h" -#include "browser_request_context.h" -#include "cef_process.h" -#include "dom_storage_context.h" +#include "libcef/browser_file_system.h" +#include "libcef/browser_request_context.h" +#include "libcef/cef_process.h" +#include "libcef/dom_storage_context.h" #include "base/at_exit.h" #include "base/file_path.h" #include "base/memory/ref_counted.h" -#include class CefBrowserImpl; class WebViewHost; @@ -24,11 +28,10 @@ namespace base { class WaitableEvent; } -class CefContext : public CefBase -{ -public: +class CefContext : public CefBase { + public: typedef std::list > BrowserList; - + CefContext(); ~CefContext(); @@ -60,14 +63,17 @@ public: std::string locale() const; // The BrowserRequestContext object is managed by CefProcessIOThread. - void set_request_context(BrowserRequestContext* request_context) - { request_context_ = request_context; } - scoped_refptr request_context() - { return request_context_; } + void set_request_context(BrowserRequestContext* request_context) { + request_context_ = request_context; + } + scoped_refptr request_context() { + return request_context_; + } // The DOMStorageContext object is managed by CefProcessUIThread. - void set_storage_context(DOMStorageContext* storage_context) - { storage_context_.reset(storage_context); } + void set_storage_context(DOMStorageContext* storage_context) { + storage_context_.reset(storage_context); + } DOMStorageContext* storage_context() { return storage_context_.get(); } BrowserFileSystem* file_system() { return &file_system_; } @@ -76,12 +82,13 @@ public: // this pointer should never be dereferenced. Use it only for comparing // pointers. WebViewHost* current_webviewhost() { return current_webviewhost_; } - void set_current_webviewhost(WebViewHost* host) - { current_webviewhost_ = host; } + void set_current_webviewhost(WebViewHost* host) { + current_webviewhost_ = host; + } static bool ImplementsThreadSafeReferenceCounting() { return true; } -private: + private: // Performs shutdown actions that need to occur on the UI thread before any // threads are destroyed. void UIT_FinishShutdown(base::WaitableEvent* browser_shutdown_event, @@ -124,4 +131,4 @@ extern CefRefPtr _Context; #define CONTEXT_STATE_VALID() \ (_Context.get() && _Context->initialized() && !_Context->shutting_down()) -#endif // _CEF_CONTEXT_H +#endif // CEF_LIBCEF_CEF_CONTEXT_H_ diff --git a/libcef/cef_process.cc b/libcef/cef_process.cc index b14173bc8..ee9e17e50 100644 --- a/libcef/cef_process.cc +++ b/libcef/cef_process.cc @@ -3,27 +3,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_process.h" -#include "cef_process_io_thread.h" -#include "cef_process_sub_thread.h" -#include "cef_process_ui_thread.h" +#include "libcef/cef_process.h" +#include "libcef/cef_process_io_thread.h" +#include "libcef/cef_process_sub_thread.h" +#include "libcef/cef_process_ui_thread.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" // Class used to process events on the current message loop. -class CefMessageLoopForUI : public MessageLoopForUI -{ +class CefMessageLoopForUI : public MessageLoopForUI { typedef MessageLoopForUI inherited; -public: + public: CefMessageLoopForUI() - : is_iterating_(true) - { + : is_iterating_(true) { } #if defined(OS_MACOSX) - virtual ~CefMessageLoopForUI() - { + virtual ~CefMessageLoopForUI() { // On Mac the MessageLoop::AutoRunState scope in Run() never exits so clear // the state_ variable to avoid an assertion in the MessageLoop destructor. state_ = NULL; @@ -82,7 +79,7 @@ CefProcess::~CefProcess() { // Terminate the FILE thread. file_thread_.reset(); - if(!multi_threaded_message_loop_) { + if (!multi_threaded_message_loop_) { // Must explicitly clean up the UI thread. ui_thread_->CleanUp(); @@ -115,7 +112,7 @@ void CefProcess::CreateUIThread() { created_ui_thread_ = true; scoped_ptr thread; - if(multi_threaded_message_loop_) { + if (multi_threaded_message_loop_) { // Create the message loop on a new thread. thread.reset(new CefProcessUIThread()); base::Thread::Options options; diff --git a/libcef/cef_process.h b/libcef/cef_process.h index d04aefdc0..81c4c7a57 100644 --- a/libcef/cef_process.h +++ b/libcef/cef_process.h @@ -8,8 +8,9 @@ // will return NULL if the service is not available, so callers must check for // this condition. -#ifndef _CEF_PROCESS_H -#define _CEF_PROCESS_H +#ifndef CEF_LIBCEF_CEF_PROCESS_H_ +#define CEF_LIBCEF_CEF_PROCESS_H_ +#pragma once #include #include @@ -34,7 +35,7 @@ class CefMessageLoopForUI; // These functions shouldn't return NULL unless otherwise noted. class CefProcess : public base::NonThreadSafe { public: - CefProcess(bool multi_threaded_message_loop); + explicit CefProcess(bool multi_threaded_message_loop); virtual ~CefProcess(); // Creates key child threads. We need to do this explicitly since @@ -118,4 +119,4 @@ class CefProcess : public base::NonThreadSafe { DISALLOW_COPY_AND_ASSIGN(CefProcess); }; -#endif // _CEF_PROCESS_H +#endif // CEF_LIBCEF_CEF_PROCESS_H_ diff --git a/libcef/cef_process_io_thread.cc b/libcef/cef_process_io_thread.cc index 5afa4e887..fb4f445ef 100644 --- a/libcef/cef_process_io_thread.cc +++ b/libcef/cef_process_io_thread.cc @@ -3,19 +3,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_process_io_thread.h" -#include "cef_context.h" -#include "browser_appcache_system.h" -#include "browser_file_writer.h" -#include "browser_resource_loader_bridge.h" -#include "browser_socket_stream_bridge.h" -#include "browser_webblobregistry_impl.h" +#include "libcef/cef_process_io_thread.h" + +#include "libcef/cef_context.h" +#include "libcef/browser_appcache_system.h" +#include "libcef/browser_file_writer.h" +#include "libcef/browser_resource_loader_bridge.h" +#include "libcef/browser_socket_stream_bridge.h" +#include "libcef/browser_webblobregistry_impl.h" #include "build/build_config.h" +#include "base/compiler_specific.h" #include "net/socket/client_socket_pool_manager.h" #if defined(OS_WIN) -#include +#include // NOLINT(build/include_order) #endif CefProcessIOThread::CefProcessIOThread() diff --git a/libcef/cef_process_io_thread.h b/libcef/cef_process_io_thread.h index fa3057a14..6aad3f3db 100644 --- a/libcef/cef_process_io_thread.h +++ b/libcef/cef_process_io_thread.h @@ -3,12 +3,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _CEF_PROCESS_IO_THREAD -#define _CEF_PROCESS_IO_THREAD +#ifndef CEF_LIBCEF_CEF_PROCESS_IO_THREAD_H_ +#define CEF_LIBCEF_CEF_PROCESS_IO_THREAD_H_ +#pragma once + +#include "libcef/browser_request_context.h" +#include "libcef/cef_thread.h" #include "base/basictypes.h" -#include "cef_thread.h" -#include "browser_request_context.h" // ---------------------------------------------------------------------------- // CefProcessIOThread @@ -21,15 +23,16 @@ // functions, so this class initializes COM for those users. class CefProcessIOThread : public CefThread { public: - explicit CefProcessIOThread(); - CefProcessIOThread(MessageLoop* message_loop); + CefProcessIOThread(); + explicit CefProcessIOThread(MessageLoop* message_loop); virtual ~CefProcessIOThread(); virtual void Init(); virtual void CleanUp(); - scoped_refptr request_context() - { return request_context_; } + scoped_refptr request_context() { + return request_context_; + } private: scoped_refptr request_context_; @@ -37,4 +40,4 @@ class CefProcessIOThread : public CefThread { DISALLOW_COPY_AND_ASSIGN(CefProcessIOThread); }; -#endif // _CEF_PROCESS_UI_THREAD +#endif // CEF_LIBCEF_CEF_PROCESS_IO_THREAD_H_ diff --git a/libcef/cef_process_sub_thread.cc b/libcef/cef_process_sub_thread.cc index a61a1f2bd..112b0a70f 100644 --- a/libcef/cef_process_sub_thread.cc +++ b/libcef/cef_process_sub_thread.cc @@ -3,11 +3,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_process_sub_thread.h" +#include "libcef/cef_process_sub_thread.h" + #include "build/build_config.h" +#include "base/compiler_specific.h" #if defined(OS_WIN) -#include +#include // NOLINT(build/include_order) #endif CefProcessSubThread::CefProcessSubThread(CefThread::ID identifier) diff --git a/libcef/cef_process_sub_thread.h b/libcef/cef_process_sub_thread.h index 31a33bd68..e43bec285 100644 --- a/libcef/cef_process_sub_thread.h +++ b/libcef/cef_process_sub_thread.h @@ -3,11 +3,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _CEF_PROCESS_SUB_THREAD -#define _CEF_PROCESS_SUB_THREAD +#ifndef CEF_LIBCEF_CEF_PROCESS_SUB_THREAD_H_ +#define CEF_LIBCEF_CEF_PROCESS_SUB_THREAD_H_ +#pragma once + +#include "libcef/cef_thread.h" #include "base/basictypes.h" -#include "cef_thread.h" // ---------------------------------------------------------------------------- // CefProcessSubThread @@ -32,4 +34,4 @@ class CefProcessSubThread : public CefThread { DISALLOW_COPY_AND_ASSIGN(CefProcessSubThread); }; -#endif // _CEF_PROCESS_SUB_THREAD +#endif // CEF_LIBCEF_CEF_PROCESS_SUB_THREAD_H_ diff --git a/libcef/cef_process_ui_thread.cc b/libcef/cef_process_ui_thread.cc index fe27a709c..dbb8dc146 100644 --- a/libcef/cef_process_ui_thread.cc +++ b/libcef/cef_process_ui_thread.cc @@ -3,11 +3,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_process_ui_thread.h" -#include "browser_webkit_glue.h" -#include "browser_webkit_init.h" -#include "cef_context.h" +#include "libcef/cef_process_ui_thread.h" #include "include/cef_version.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/browser_webkit_init.h" +#include "libcef/cef_context.h" #include "base/bind.h" #include "base/command_line.h" @@ -28,8 +28,8 @@ #include "webkit/plugins/npapi/plugin_list.h" #if defined(OS_WIN) -#include -#include +#include // NOLINT(build/include_order) +#include // NOLINT(build/include_order) #endif static const char* kStatsFilePrefix = "libcef_"; @@ -75,7 +75,7 @@ void CefProcessUIThread::Init() { // Load ICU data tables. bool ret = icu_util::Initialize(); - if(!ret) { + if (!ret) { #if defined(OS_WIN) MessageBox(NULL, L"Failed to load the required icudt library", L"CEF Initialization Error", MB_ICONERROR | MB_OK); @@ -131,8 +131,10 @@ void CefProcessUIThread::Init() { // Set storage quota limits. if (settings.local_storage_quota != 0) DOMStorageContext::set_local_storage_quota(settings.local_storage_quota); - if (settings.session_storage_quota != 0) - DOMStorageContext::set_session_storage_quota(settings.session_storage_quota); + if (settings.session_storage_quota != 0) { + DOMStorageContext::set_session_storage_quota( + settings.session_storage_quota); + } // Create the storage context object. _Context->set_storage_context(new DOMStorageContext(_Context->cache_path())); @@ -153,14 +155,14 @@ void CefProcessUIThread::Init() { webkit_glue::SetUserAgent( webkit_glue::BuildUserAgentFromProduct(product_version), false); } - + if (settings.extra_plugin_paths) { cef_string_t str; memset(&str, 0, sizeof(str)); FilePath path; int size = cef_string_list_size(settings.extra_plugin_paths); - for(int i = 0; i < size; ++i) { + for (int i = 0; i < size; ++i) { if (!cef_string_list_value(settings.extra_plugin_paths, i, &str)) continue; path = FilePath(CefString(&str)); diff --git a/libcef/cef_process_ui_thread.h b/libcef/cef_process_ui_thread.h index c75184734..10fe8b417 100644 --- a/libcef/cef_process_ui_thread.h +++ b/libcef/cef_process_ui_thread.h @@ -3,12 +3,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _CEF_PROCESS_UI_THREAD -#define _CEF_PROCESS_UI_THREAD +#ifndef CEF_LIBCEF_CEF_PROCESS_UI_THREAD_H_ +#define CEF_LIBCEF_CEF_PROCESS_UI_THREAD_H_ +#pragma once + +#include "libcef/cef_thread.h" #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" -#include "cef_thread.h" #include "media/audio/audio_manager.h" #include "net/base/network_change_notifier.h" @@ -28,11 +30,10 @@ class StatsTable; // functions, so this class initializes COM for those users. class CefProcessUIThread : public net::NetworkChangeNotifier::OnlineStateObserver, - public CefThread -{ + public CefThread { public: - explicit CefProcessUIThread(); - CefProcessUIThread(MessageLoop* message_loop); + CefProcessUIThread(); + explicit CefProcessUIThread(MessageLoop* message_loop); virtual ~CefProcessUIThread(); virtual void Init(); @@ -58,4 +59,4 @@ class CefProcessUIThread DISALLOW_COPY_AND_ASSIGN(CefProcessUIThread); }; -#endif // _CEF_PROCESS_UI_THREAD +#endif // CEF_LIBCEF_CEF_PROCESS_UI_THREAD_H_ diff --git a/libcef/cef_process_ui_thread_gtk.cc b/libcef/cef_process_ui_thread_gtk.cc index 2048d8a35..40b1593fe 100644 --- a/libcef/cef_process_ui_thread_gtk.cc +++ b/libcef/cef_process_ui_thread_gtk.cc @@ -2,14 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "cef_process_ui_thread.h" -#include "browser_impl.h" +#include "libcef/cef_process_ui_thread.h" +#include "libcef/browser_impl.h" void CefProcessUIThread::PlatformInit() { - } void CefProcessUIThread::PlatformCleanUp() { - } diff --git a/libcef/cef_process_ui_thread_mac.mm b/libcef/cef_process_ui_thread_mac.mm index 4be9efb3d..6485dd020 100644 --- a/libcef/cef_process_ui_thread_mac.mm +++ b/libcef/cef_process_ui_thread_mac.mm @@ -6,9 +6,9 @@ #import #import "include/cef_application_mac.h" -#include "cef_process_ui_thread.h" -#include "browser_webkit_glue.h" -#include "cef_context.h" +#include "libcef/cef_process_ui_thread.h" +#include "libcef/browser_webkit_glue.h" +#include "libcef/cef_context.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.h" diff --git a/libcef/cef_process_ui_thread_win.cc b/libcef/cef_process_ui_thread_win.cc index 22b7c1ef8..206f52731 100644 --- a/libcef/cef_process_ui_thread_win.cc +++ b/libcef/cef_process_ui_thread_win.cc @@ -3,11 +3,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_process_ui_thread.h" -#include "browser_impl.h" +#include "libcef/cef_process_ui_thread.h" + #include #include +#include "libcef/browser_impl.h" + void CefProcessUIThread::PlatformInit() { HRESULT res; diff --git a/libcef/cef_string_list.cc b/libcef/cef_string_list.cc index 92a21c75d..fbc2b2ce1 100644 --- a/libcef/cef_string_list.cc +++ b/libcef/cef_string_list.cc @@ -2,63 +2,57 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#include #include "include/internal/cef_string_list.h" #include "base/logging.h" -#include - typedef std::vector StringList; -CEF_EXPORT cef_string_list_t cef_string_list_alloc() -{ +CEF_EXPORT cef_string_list_t cef_string_list_alloc() { return new StringList; } -CEF_EXPORT int cef_string_list_size(cef_string_list_t list) -{ +CEF_EXPORT int cef_string_list_size(cef_string_list_t list) { DCHECK(list); - StringList* impl = (StringList*)list; + StringList* impl = reinterpret_cast(list); return impl->size(); } CEF_EXPORT int cef_string_list_value(cef_string_list_t list, int index, - cef_string_t* value) -{ + cef_string_t* value) { DCHECK(list); DCHECK(value); - StringList* impl = (StringList*)list; - DCHECK(index >= 0 && index < (int)impl->size()); - if(index < 0 || index >= (int)impl->size()) + StringList* impl = reinterpret_cast(list); + DCHECK_GE(index, 0); + DCHECK_LT(index, static_cast(impl->size())); + if (index < 0 || index >= static_cast(impl->size())) return false; const CefString& str = (*impl)[index]; return cef_string_copy(str.c_str(), str.length(), value); } CEF_EXPORT void cef_string_list_append(cef_string_list_t list, - const cef_string_t* value) -{ + const cef_string_t* value) { DCHECK(list); DCHECK(value); - StringList* impl = (StringList*)list; + StringList* impl = reinterpret_cast(list); impl->push_back(CefString(value)); } -CEF_EXPORT void cef_string_list_clear(cef_string_list_t list) -{ +CEF_EXPORT void cef_string_list_clear(cef_string_list_t list) { DCHECK(list); - StringList* impl = (StringList*)list; + StringList* impl = reinterpret_cast(list); impl->clear(); } -CEF_EXPORT void cef_string_list_free(cef_string_list_t list) -{ +CEF_EXPORT void cef_string_list_free(cef_string_list_t list) { DCHECK(list); - delete (StringList*)list; + StringList* impl = reinterpret_cast(list); + delete impl; } -CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list) -{ +CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list) { DCHECK(list); - StringList* impl = (StringList*)list; + StringList* impl = reinterpret_cast(list); return new StringList(*impl); } diff --git a/libcef/cef_string_map.cc b/libcef/cef_string_map.cc index cd30e5368..9538ab05e 100644 --- a/libcef/cef_string_map.cc +++ b/libcef/cef_string_map.cc @@ -2,68 +2,67 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#include #include "include/internal/cef_string_map.h" #include "base/logging.h" -#include - typedef std::map StringMap; -CEF_EXPORT cef_string_map_t cef_string_map_alloc() -{ +CEF_EXPORT cef_string_map_t cef_string_map_alloc() { return new StringMap; } -CEF_EXPORT int cef_string_map_size(cef_string_map_t map) -{ +CEF_EXPORT int cef_string_map_size(cef_string_map_t map) { DCHECK(map); - StringMap* impl = (StringMap*)map; + StringMap* impl = reinterpret_cast(map); return impl->size(); } CEF_EXPORT int cef_string_map_find(cef_string_map_t map, const cef_string_t* key, - cef_string_t* value) -{ + cef_string_t* value) { DCHECK(map); DCHECK(value); - StringMap* impl = (StringMap*)map; + StringMap* impl = reinterpret_cast(map); StringMap::const_iterator it = impl->find(CefString(key)); - if(it == impl->end()) + if (it == impl->end()) return 0; + const CefString& val = it->second; return cef_string_set(val.c_str(), val.length(), value, true); } CEF_EXPORT int cef_string_map_key(cef_string_map_t map, int index, - cef_string_t* key) -{ + cef_string_t* key) { DCHECK(map); DCHECK(key); - StringMap* impl = (StringMap*)map; - DCHECK(index >= 0 && index < (int)impl->size()); - if(index < 0 || index >= (int)impl->size()) + StringMap* impl = reinterpret_cast(map); + DCHECK_GE(index, 0); + DCHECK_LT(index, static_cast(impl->size())); + if (index < 0 || index >= static_cast(impl->size())) return 0; + StringMap::const_iterator it = impl->begin(); - for(int ct = 0; it != impl->end(); ++it, ct++) { - if(ct == index) + for (int ct = 0; it != impl->end(); ++it, ct++) { + if (ct == index) return cef_string_set(it->first.c_str(), it->first.length(), key, true); } return 0; } CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index, - cef_string_t* value) -{ + cef_string_t* value) { DCHECK(map); DCHECK(value); - StringMap* impl = (StringMap*)map; - DCHECK(index >= 0 && index < (int)impl->size()); - if(index < 0 || index >= (int)impl->size()) + StringMap* impl = reinterpret_cast(map); + DCHECK_GE(index, 0); + DCHECK_LT(index, static_cast(impl->size())); + if (index < 0 || index >= static_cast(impl->size())) return 0; + StringMap::const_iterator it = impl->begin(); - for(int ct = 0; it != impl->end(); ++it, ct++) { - if(ct == index) { + for (int ct = 0; it != impl->end(); ++it, ct++) { + if (ct == index) { return cef_string_set(it->second.c_str(), it->second.length(), value, true); } @@ -73,23 +72,21 @@ CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index, CEF_EXPORT int cef_string_map_append(cef_string_map_t map, const cef_string_t* key, - const cef_string_t* value) -{ + const cef_string_t* value) { DCHECK(map); - StringMap* impl = (StringMap*)map; + StringMap* impl = reinterpret_cast(map); impl->insert(std::make_pair(CefString(key), CefString(value))); return 1; } -CEF_EXPORT void cef_string_map_clear(cef_string_map_t map) -{ +CEF_EXPORT void cef_string_map_clear(cef_string_map_t map) { DCHECK(map); - StringMap* impl = (StringMap*)map; + StringMap* impl = reinterpret_cast(map); impl->clear(); } -CEF_EXPORT void cef_string_map_free(cef_string_map_t map) -{ +CEF_EXPORT void cef_string_map_free(cef_string_map_t map) { DCHECK(map); - delete (StringMap*)map; + StringMap* impl = reinterpret_cast(map); + delete impl; } diff --git a/libcef/cef_string_multimap.cc b/libcef/cef_string_multimap.cc index 7301cef38..1daf4a8a9 100644 --- a/libcef/cef_string_multimap.cc +++ b/libcef/cef_string_multimap.cc @@ -2,50 +2,44 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#include #include "include/internal/cef_string_multimap.h" #include "base/logging.h" -#include - typedef std::multimap StringMultimap; -typedef StringMultimap::const_iterator StringMultimapIter; -CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc() -{ +CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc() { return new StringMultimap; } -CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map) -{ +CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map) { DCHECK(map); - StringMultimap* impl = (StringMultimap*)map; + StringMultimap* impl = reinterpret_cast(map); return impl->size(); } CEF_EXPORT int cef_string_multimap_find_count(cef_string_multimap_t map, - const cef_string_t* key) -{ + const cef_string_t* key) { DCHECK(map); DCHECK(key); - StringMultimap* impl = (StringMultimap*)map; + StringMultimap* impl = reinterpret_cast(map); return impl->count(CefString(key)); } CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, const cef_string_t* key, int value_index, - cef_string_t* value) -{ + cef_string_t* value) { DCHECK(map); DCHECK(key); DCHECK(value); - StringMultimap* impl = (StringMultimap*)map; + StringMultimap* impl = reinterpret_cast(map); CefString key_str(key); - DCHECK(value_index >= 0 && value_index < (int)impl->count(key_str)); - - if(value_index < 0 || value_index >= (int)impl->count(key_str)) + DCHECK_GE(value_index, 0); + DCHECK_LT(value_index, static_cast(impl->count(key_str))); + if (value_index < 0 || value_index >= static_cast(impl->count(key_str))) return 0; std::pair range_it = @@ -63,34 +57,36 @@ CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, } CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, int index, - cef_string_t* key) -{ + cef_string_t* key) { DCHECK(map); DCHECK(key); - StringMultimap* impl = (StringMultimap*)map; - DCHECK(index >= 0 && index < (int)impl->size()); - if(index < 0 || index >= (int)impl->size()) + StringMultimap* impl = reinterpret_cast(map); + DCHECK_GE(index, 0); + DCHECK_LT(index, static_cast(impl->size())); + if (index < 0 || index >= static_cast(impl->size())) return 0; + StringMultimap::const_iterator it = impl->begin(); - for(int ct = 0; it != impl->end(); ++it, ct++) { - if(ct == index) + for (int ct = 0; it != impl->end(); ++it, ct++) { + if (ct == index) return cef_string_set(it->first.c_str(), it->first.length(), key, true); } return 0; } CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index, - cef_string_t* value) -{ + cef_string_t* value) { DCHECK(map); DCHECK(value); - StringMultimap* impl = (StringMultimap*)map; - DCHECK(index >= 0 && index < (int)impl->size()); - if(index < 0 || index >= (int)impl->size()) + StringMultimap* impl = reinterpret_cast(map); + DCHECK_GE(index, 0); + DCHECK_LT(index, static_cast(impl->size())); + if (index < 0 || index >= static_cast(impl->size())) return 0; + StringMultimap::const_iterator it = impl->begin(); - for(int ct = 0; it != impl->end(); ++it, ct++) { - if(ct == index) { + for (int ct = 0; it != impl->end(); ++it, ct++) { + if (ct == index) { return cef_string_set(it->second.c_str(), it->second.length(), value, true); } @@ -100,23 +96,21 @@ CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index, CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map, const cef_string_t* key, - const cef_string_t* value) -{ + const cef_string_t* value) { DCHECK(map); - StringMultimap* impl = (StringMultimap*)map; + StringMultimap* impl = reinterpret_cast(map); impl->insert(std::make_pair(CefString(key), CefString(value))); return 1; } -CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map) -{ +CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map) { DCHECK(map); - StringMultimap* impl = (StringMultimap*)map; + StringMultimap* impl = reinterpret_cast(map); impl->clear(); } -CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map) -{ +CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map) { DCHECK(map); - delete (StringMultimap*)map; + StringMultimap* impl = reinterpret_cast(map); + delete impl; } diff --git a/libcef/cef_string_types.cc b/libcef/cef_string_types.cc index 2a9942c8c..cf82d381f 100644 --- a/libcef/cef_string_types.cc +++ b/libcef/cef_string_types.cc @@ -9,26 +9,22 @@ namespace { -void string_wide_dtor(wchar_t* str) -{ +void string_wide_dtor(wchar_t* str) { delete [] str; } -void string_utf8_dtor(char* str) -{ +void string_utf8_dtor(char* str) { delete [] str; } -void string_utf16_dtor(char16* str) -{ +void string_utf16_dtor(char16* str) { delete [] str; } -} // namespace +} // namespace CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, - cef_string_wide_t* output, int copy) -{ + cef_string_wide_t* output, int copy) { cef_string_wide_clear(output); if (copy) { @@ -51,10 +47,8 @@ CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, } CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, - cef_string_utf8_t* output, int copy) -{ + cef_string_utf8_t* output, int copy) { cef_string_utf8_clear(output); - if (copy) { if (src && src_len > 0) { output->str = new char[src_len+1]; @@ -75,10 +69,9 @@ CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, } CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, - cef_string_utf16_t* output, int copy) -{ + cef_string_utf16_t* output, int copy) { cef_string_utf16_clear(output); - + if (copy) { if (src && src_len > 0) { output->str = new char16[src_len+1]; @@ -98,8 +91,7 @@ CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, return 1; } -CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str) -{ +CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str) { DCHECK(str != NULL); if (str->dtor && str->str) str->dtor(str->str); @@ -109,8 +101,7 @@ CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str) str->dtor = NULL; } -CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str) -{ +CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str) { DCHECK(str != NULL); if (str->dtor && str->str) str->dtor(str->str); @@ -120,8 +111,7 @@ CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str) str->dtor = NULL; } -CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str) -{ +CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str) { DCHECK(str != NULL); if (str->dtor && str->str) str->dtor(str->str); @@ -132,8 +122,7 @@ CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str) } CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1, - const cef_string_wide_t* str2) -{ + const cef_string_wide_t* str2) { if (str1->length == 0 && str2->length == 0) return 0; int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length)); @@ -147,8 +136,7 @@ CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1, } CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1, - const cef_string_utf8_t* str2) -{ + const cef_string_utf8_t* str2) { if (str1->length == 0 && str2->length == 0) return 0; int r = strncmp(str1->str, str2->str, std::min(str1->length, str2->length)); @@ -162,8 +150,7 @@ CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1, } CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, - const cef_string_utf16_t* str2) -{ + const cef_string_utf16_t* str2) { if (str1->length == 0 && str2->length == 0) return 0; #if defined(WCHAR_T_IS_UTF32) @@ -182,8 +169,7 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, } CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, - cef_string_utf8_t* output) -{ + cef_string_utf8_t* output) { std::string str; bool ret = WideToUTF8(src, src_len, &str); if (!cef_string_utf8_set(str.c_str(), str.length(), output, true)) @@ -192,8 +178,7 @@ CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, } CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, - cef_string_wide_t* output) -{ + cef_string_wide_t* output) { std::wstring str; bool ret = UTF8ToWide(src, src_len, &str); if (!cef_string_wide_set(str.c_str(), str.length(), output, true)) @@ -202,8 +187,7 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, } CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, - cef_string_utf16_t* output) -{ + cef_string_utf16_t* output) { string16 str; bool ret = WideToUTF16(src, src_len, &str); if (!cef_string_utf16_set(str.c_str(), str.length(), output, true)) @@ -212,8 +196,7 @@ CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, } CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, - cef_string_wide_t* output) -{ + cef_string_wide_t* output) { std::wstring str; bool ret = UTF16ToWide(src, src_len, &str); if (!cef_string_wide_set(str.c_str(), str.length(), output, true)) @@ -222,8 +205,7 @@ CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, } CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, - cef_string_utf16_t* output) -{ + cef_string_utf16_t* output) { string16 str; bool ret = UTF8ToUTF16(src, src_len, &str); if (!cef_string_utf16_set(str.c_str(), str.length(), output, true)) @@ -232,8 +214,7 @@ CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, } CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, - cef_string_utf8_t* output) -{ + cef_string_utf8_t* output) { std::string str; bool ret = UTF16ToUTF8(src, src_len, &str); if (!cef_string_utf8_set(str.c_str(), str.length(), output, true)) @@ -242,54 +223,47 @@ CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, } CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len, - cef_string_wide_t* output) -{ + cef_string_wide_t* output) { std::wstring str = ASCIIToWide(std::string(src, src_len)); return cef_string_wide_set(str.c_str(), str.length(), output, true); } CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, - cef_string_utf16_t* output) -{ + cef_string_utf16_t* output) { string16 str = ASCIIToUTF16(std::string(src, src_len)); return cef_string_utf16_set(str.c_str(), str.length(), output, true); } -CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc() -{ +CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc() { cef_string_wide_t* s = new cef_string_wide_t; memset(s, 0, sizeof(cef_string_wide_t)); return s; } -CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc() -{ +CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc() { cef_string_utf8_t* s = new cef_string_utf8_t; memset(s, 0, sizeof(cef_string_utf8_t)); return s; } -CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc() -{ +CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc() { cef_string_utf16_t* s = new cef_string_utf16_t; memset(s, 0, sizeof(cef_string_utf16_t)); return s; } -CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str) -{ +CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str) { cef_string_wide_clear(str); delete str; } -CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str) -{ +CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str) { cef_string_utf8_clear(str); delete str; } -CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str) -{ +CEF_EXPORT void cef_string_userfree_utf16_free( + cef_string_userfree_utf16_t str) { cef_string_utf16_clear(str); delete str; } diff --git a/libcef/cef_thread.cc b/libcef/cef_thread.cc index b157b0d3f..5036d161c 100644 --- a/libcef/cef_thread.cc +++ b/libcef/cef_thread.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_thread.h" +#include "libcef/cef_thread.h" #include "base/compiler_specific.h" #include "base/message_loop.h" diff --git a/libcef/cef_thread.h b/libcef/cef_thread.h index 6cd29f065..7b4fcb844 100644 --- a/libcef/cef_thread.h +++ b/libcef/cef_thread.h @@ -3,8 +3,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _CEF_THREAD_H -#define _CEF_THREAD_H +#ifndef CEF_LIBCEF_CEF_THREAD_H_ +#define CEF_LIBCEF_CEF_THREAD_H_ +#pragma once #include "base/synchronization/lock.h" #include "base/task.h" @@ -88,7 +89,7 @@ class CefThread : public base::Thread { const tracked_objects::Location& from_here, Task* task, int64 delay_ms); - + // TODO(ajwong): Remove the functions above once the Task -> Closure migration // is complete. // @@ -215,4 +216,4 @@ class CefThread : public base::Thread { #define REQUIRE_UIT() DCHECK(CefThread::CurrentlyOn(CefThread::UI)) #define REQUIRE_IOT() DCHECK(CefThread::CurrentlyOn(CefThread::IO)) -#endif // _CEF_THREAD_H +#endif // CEF_LIBCEF_CEF_THREAD_H_ diff --git a/libcef/cef_time.cc b/libcef/cef_time.cc index 4d5e85e61..7fef1bda3 100644 --- a/libcef/cef_time.cc +++ b/libcef/cef_time.cc @@ -2,10 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "cef_time_util.h" +#include "libcef/cef_time_util.h" -void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time) -{ +void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time) { base::Time::Exploded exploded; exploded.year = cef_time.year; exploded.month = cef_time.month; @@ -20,8 +19,7 @@ void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time) time = base::Time::FromUTCExploded(exploded); } -void cef_time_from_basetime(const base::Time& time, cef_time_t& cef_time) -{ +void cef_time_from_basetime(const base::Time& time, cef_time_t& cef_time) { base::Time::Exploded exploded; time.UTCExplode(&exploded); cef_time.year = exploded.year; @@ -36,8 +34,7 @@ void cef_time_from_basetime(const base::Time& time, cef_time_t& cef_time) cef_time.millisecond = exploded.millisecond; } -CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time) -{ +CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time) { if (!cef_time || !time) return 0; @@ -47,8 +44,7 @@ CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time) return 1; } -CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time) -{ +CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time) { if (!cef_time) return 0; @@ -57,8 +53,7 @@ CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time) return 1; } -CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time) -{ +CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time) { if (!cef_time || !time) return 0; @@ -68,8 +63,7 @@ CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time) return 1; } -CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time) -{ +CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time) { if (!cef_time) return 0; diff --git a/libcef/cef_time_util.h b/libcef/cef_time_util.h index e78198f83..7996ff0ef 100644 --- a/libcef/cef_time_util.h +++ b/libcef/cef_time_util.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _CEF_TIME_UTIL_H -#define _CEF_TIME_UTIL_H +#ifndef CEF_LIBCEF_CEF_TIME_UTIL_H_ +#define CEF_LIBCEF_CEF_TIME_UTIL_H_ +#pragma once #include "include/internal/cef_time.h" #include "base/time.h" @@ -12,4 +13,4 @@ void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time); void cef_time_from_basetime(const base::Time& time, cef_time_t& cef_time); -#endif // _CEF_TIME_UTIL_H +#endif // CEF_LIBCEF_CEF_TIME_UTIL_H_ diff --git a/libcef/command_line_impl.cc b/libcef/command_line_impl.cc index ddaafabdc..2cd304016 100644 --- a/libcef/command_line_impl.cc +++ b/libcef/command_line_impl.cc @@ -9,16 +9,13 @@ namespace { -class CefCommandLineImpl : public CefCommandLine -{ -public: +class CefCommandLineImpl : public CefCommandLine { + public: CefCommandLineImpl() - : command_line_(CommandLine::NO_PROGRAM) - { + : command_line_(CommandLine::NO_PROGRAM) { } - virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE - { + virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE { #if !defined(OS_WIN) AutoLock lock_scope(this); command_line_.InitFromArgv(argc, argv); @@ -27,8 +24,7 @@ public: #endif } - virtual void InitFromString(const CefString& command_line) OVERRIDE - { + virtual void InitFromString(const CefString& command_line) OVERRIDE { #if defined(OS_WIN) AutoLock lock_scope(this); command_line_.ParseFromString(command_line); @@ -37,44 +33,37 @@ public: #endif } - virtual CefString GetCommandLineString() OVERRIDE - { + virtual CefString GetCommandLineString() OVERRIDE { AutoLock lock_scope(this); return command_line_.GetCommandLineString(); } - virtual CefString GetProgram() OVERRIDE - { + virtual CefString GetProgram() OVERRIDE { AutoLock lock_scope(this); return command_line_.GetProgram().value(); } - virtual void SetProgram(const CefString& program) OVERRIDE - { + virtual void SetProgram(const CefString& program) OVERRIDE { AutoLock lock_scope(this); command_line_.SetProgram(FilePath(program)); } - virtual bool HasSwitches() OVERRIDE - { + virtual bool HasSwitches() OVERRIDE { AutoLock lock_scope(this); return (command_line_.GetSwitches().size() > 0); } - virtual bool HasSwitch(const CefString& name) OVERRIDE - { + virtual bool HasSwitch(const CefString& name) OVERRIDE { AutoLock lock_scope(this); return command_line_.HasSwitch(name); } - virtual CefString GetSwitchValue(const CefString& name) OVERRIDE - { + virtual CefString GetSwitchValue(const CefString& name) OVERRIDE { AutoLock lock_scope(this); return command_line_.GetSwitchValueNative(name); } - virtual void GetSwitches(SwitchMap& switches) OVERRIDE - { + virtual void GetSwitches(SwitchMap& switches) OVERRIDE { AutoLock lock_scope(this); const CommandLine::SwitchMap& map = command_line_.GetSwitches(); CommandLine::SwitchMap::const_iterator it = map.begin(); @@ -82,27 +71,23 @@ public: switches.insert(std::make_pair(it->first, it->second)); } - virtual void AppendSwitch(const CefString& name) OVERRIDE - { + virtual void AppendSwitch(const CefString& name) OVERRIDE { AutoLock lock_scope(this); command_line_.AppendSwitch(name); } virtual void AppendSwitchWithValue(const CefString& name, - const CefString& value) OVERRIDE - { + const CefString& value) OVERRIDE { AutoLock lock_scope(this); command_line_.AppendSwitchNative(name, value); } - virtual bool HasArguments() OVERRIDE - { + virtual bool HasArguments() OVERRIDE { AutoLock lock_scope(this); return (command_line_.GetArgs().size() > 0); } - virtual void GetArguments(ArgumentList& arguments) OVERRIDE - { + virtual void GetArguments(ArgumentList& arguments) OVERRIDE { AutoLock lock_scope(this); const CommandLine::StringVector& vec = command_line_.GetArgs(); CommandLine::StringVector::const_iterator it = vec.begin(); @@ -110,23 +95,21 @@ public: arguments.push_back(*it); } - virtual void AppendArgument(const CefString& argument) OVERRIDE - { + virtual void AppendArgument(const CefString& argument) OVERRIDE { AutoLock lock_scope(this); command_line_.AppendArgNative(argument); } -private: + private: CommandLine command_line_; IMPLEMENT_REFCOUNTING(CefCommandLineImpl); IMPLEMENT_LOCKING(CefCommandLineImpl); }; -} // namespace +} // namespace // static -CefRefPtr CefCommandLine::CreateCommandLine() -{ +CefRefPtr CefCommandLine::CreateCommandLine() { return new CefCommandLineImpl(); } diff --git a/libcef/cookie_impl.cc b/libcef/cookie_impl.cc index 6d3ed4fda..1ff22257a 100644 --- a/libcef/cookie_impl.cc +++ b/libcef/cookie_impl.cc @@ -3,9 +3,9 @@ // be found in the LICENSE file. #include "include/cef_cookie.h" -#include "cef_context.h" -#include "cef_thread.h" -#include "cef_time_util.h" +#include "libcef/cef_context.h" +#include "libcef/cef_thread.h" +#include "libcef/cef_time_util.h" #include "net/base/cookie_monster.h" @@ -13,14 +13,12 @@ namespace { // Callback class for visiting cookies. class VisitCookiesCallback : public base::RefCounted { -public: - VisitCookiesCallback(CefRefPtr visitor) - : visitor_(visitor) - { + public: + explicit VisitCookiesCallback(CefRefPtr visitor) + : visitor_(visitor) { } - void Run(const net::CookieList& list) - { + void Run(const net::CookieList& list) { REQUIRE_IOT(); net::CookieMonster* cookie_monster = static_cast( @@ -29,12 +27,12 @@ public: return; int total = list.size(), count = 0; - + net::CookieList::const_iterator it = list.begin(); for (; it != list.end(); ++it, ++count) { CefCookie cookie; const net::CookieMonster::CanonicalCookie& cc = *(it); - + CefString(&cookie.name).FromString(cc.Name()); CefString(&cookie.value).FromString(cc.Value()); CefString(&cookie.domain).FromString(cc.Domain()); @@ -58,12 +56,11 @@ public: } } -private: + private: CefRefPtr visitor_; }; -void IOT_VisitAllCookies(CefRefPtr visitor) -{ +void IOT_VisitAllCookies(CefRefPtr visitor) { REQUIRE_IOT(); net::CookieMonster* cookie_monster = static_cast( @@ -79,8 +76,7 @@ void IOT_VisitAllCookies(CefRefPtr visitor) } void IOT_VisitUrlCookies(const GURL& url, bool includeHttpOnly, - CefRefPtr visitor) -{ + CefRefPtr visitor) { REQUIRE_IOT(); net::CookieMonster* cookie_monster = static_cast( @@ -91,7 +87,7 @@ void IOT_VisitUrlCookies(const GURL& url, bool includeHttpOnly, net::CookieOptions options; if (includeHttpOnly) options.set_include_httponly(); - + scoped_refptr callback( new VisitCookiesCallback(visitor)); @@ -99,8 +95,7 @@ void IOT_VisitUrlCookies(const GURL& url, bool includeHttpOnly, base::Bind(&VisitCookiesCallback::Run, callback.get())); } -void IOT_SetCookiePath(const CefString& path) -{ +void IOT_SetCookiePath(const CefString& path) { REQUIRE_IOT(); FilePath cookie_path; @@ -110,10 +105,9 @@ void IOT_SetCookiePath(const CefString& path) _Context->request_context()->SetCookieStoragePath(cookie_path); } -} // anonymous +} // namespace -bool CefVisitAllCookies(CefRefPtr visitor) -{ +bool CefVisitAllCookies(CefRefPtr visitor) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -125,8 +119,7 @@ bool CefVisitAllCookies(CefRefPtr visitor) } bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) -{ + CefRefPtr visitor) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -142,8 +135,7 @@ bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, NewRunnableFunction(IOT_VisitUrlCookies, gurl, includeHttpOnly, visitor)); } -bool CefSetCookie(const CefString& url, const CefCookie& cookie) -{ +bool CefSetCookie(const CefString& url, const CefCookie& cookie) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -170,7 +162,7 @@ bool CefSetCookie(const CefString& url, const CefCookie& cookie) std::string value = CefString(&cookie.value).ToString(); std::string domain = CefString(&cookie.domain).ToString(); std::string path = CefString(&cookie.path).ToString(); - + base::Time expiration_time; if (cookie.has_expires) cef_time_to_basetime(cookie.expires, expiration_time); @@ -181,8 +173,7 @@ bool CefSetCookie(const CefString& url, const CefCookie& cookie) return true; } -bool CefDeleteCookies(const CefString& url, const CefString& cookie_name) -{ +bool CefDeleteCookies(const CefString& url, const CefString& cookie_name) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -222,8 +213,7 @@ bool CefDeleteCookies(const CefString& url, const CefString& cookie_name) return true; } -bool CefSetCookiePath(const CefString& path) -{ +bool CefSetCookiePath(const CefString& path) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; diff --git a/libcef/dom_document_impl.cc b/libcef/dom_document_impl.cc index 44bb56d95..3b5095582 100644 --- a/libcef/dom_document_impl.cc +++ b/libcef/dom_document_impl.cc @@ -2,9 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "dom_document_impl.h" -#include "dom_node_impl.h" -#include "cef_thread.h" +#include "libcef/dom_document_impl.h" +#include "libcef/dom_node_impl.h" +#include "libcef/cef_thread.h" #include "base/logging.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" @@ -26,22 +26,20 @@ using WebKit::WebURL; CefDOMDocumentImpl::CefDOMDocumentImpl(CefBrowserImpl* browser, WebFrame* frame) - : browser_(browser), frame_(frame) -{ + : browser_(browser), + frame_(frame) { const WebDocument& document = frame_->document(); DCHECK(!document.isNull()); } -CefDOMDocumentImpl::~CefDOMDocumentImpl() -{ +CefDOMDocumentImpl::~CefDOMDocumentImpl() { REQUIRE_UIT(); // Verify that the Detach() method has been called. DCHECK(frame_ == NULL); } -CefDOMDocumentImpl::Type CefDOMDocumentImpl::GetType() -{ +CefDOMDocumentImpl::Type CefDOMDocumentImpl::GetType() { if (!VerifyContext()) return DOM_DOCUMENT_TYPE_UNKNOWN; @@ -55,26 +53,22 @@ CefDOMDocumentImpl::Type CefDOMDocumentImpl::GetType() return DOM_DOCUMENT_TYPE_UNKNOWN; } -CefRefPtr CefDOMDocumentImpl::GetDocument() -{ +CefRefPtr CefDOMDocumentImpl::GetDocument() { const WebDocument& document = frame_->document(); return GetOrCreateNode(document.document()); } -CefRefPtr CefDOMDocumentImpl::GetBody() -{ +CefRefPtr CefDOMDocumentImpl::GetBody() { const WebDocument& document = frame_->document(); return GetOrCreateNode(document.body()); } -CefRefPtr CefDOMDocumentImpl::GetHead() -{ +CefRefPtr CefDOMDocumentImpl::GetHead() { WebDocument document = frame_->document(); return GetOrCreateNode(document.head()); } -CefString CefDOMDocumentImpl::GetTitle() -{ +CefString CefDOMDocumentImpl::GetTitle() { CefString str; if (!VerifyContext()) return str; @@ -87,28 +81,24 @@ CefString CefDOMDocumentImpl::GetTitle() return str; } -CefRefPtr CefDOMDocumentImpl::GetElementById(const CefString& id) -{ +CefRefPtr CefDOMDocumentImpl::GetElementById(const CefString& id) { const WebDocument& document = frame_->document(); return GetOrCreateNode(document.getElementById(string16(id))); } -CefRefPtr CefDOMDocumentImpl::GetFocusedNode() -{ +CefRefPtr CefDOMDocumentImpl::GetFocusedNode() { const WebDocument& document = frame_->document(); return GetOrCreateNode(document.focusedNode()); } -bool CefDOMDocumentImpl::HasSelection() -{ +bool CefDOMDocumentImpl::HasSelection() { if (!VerifyContext()) return false; return frame_->hasSelection(); } -CefRefPtr CefDOMDocumentImpl::GetSelectionStartNode() -{ +CefRefPtr CefDOMDocumentImpl::GetSelectionStartNode() { if (!VerifyContext() || !frame_->hasSelection()) return NULL; @@ -120,8 +110,7 @@ CefRefPtr CefDOMDocumentImpl::GetSelectionStartNode() return GetOrCreateNode(range.startContainer(exceptionCode)); } -int CefDOMDocumentImpl::GetSelectionStartOffset() -{ +int CefDOMDocumentImpl::GetSelectionStartOffset() { if (!VerifyContext() || !frame_->hasSelection()) return 0; @@ -132,8 +121,7 @@ int CefDOMDocumentImpl::GetSelectionStartOffset() return range.startOffset(); } -CefRefPtr CefDOMDocumentImpl::GetSelectionEndNode() -{ +CefRefPtr CefDOMDocumentImpl::GetSelectionEndNode() { if (!VerifyContext() || !frame_->hasSelection()) return NULL; @@ -145,8 +133,7 @@ CefRefPtr CefDOMDocumentImpl::GetSelectionEndNode() return GetOrCreateNode(range.endContainer(exceptionCode)); } -int CefDOMDocumentImpl::GetSelectionEndOffset() -{ +int CefDOMDocumentImpl::GetSelectionEndOffset() { if (!VerifyContext() || !frame_->hasSelection()) return 0; @@ -157,8 +144,7 @@ int CefDOMDocumentImpl::GetSelectionEndOffset() return range.endOffset(); } -CefString CefDOMDocumentImpl::GetSelectionAsMarkup() -{ +CefString CefDOMDocumentImpl::GetSelectionAsMarkup() { CefString str; if (!VerifyContext() || !frame_->hasSelection()) return str; @@ -170,8 +156,7 @@ CefString CefDOMDocumentImpl::GetSelectionAsMarkup() return str; } -CefString CefDOMDocumentImpl::GetSelectionAsText() -{ +CefString CefDOMDocumentImpl::GetSelectionAsText() { CefString str; if (!VerifyContext() || !frame_->hasSelection()) return str; @@ -183,12 +168,11 @@ CefString CefDOMDocumentImpl::GetSelectionAsText() return str; } -CefString CefDOMDocumentImpl::GetBaseURL() -{ +CefString CefDOMDocumentImpl::GetBaseURL() { CefString str; if (!VerifyContext()) return str; - + const WebDocument& document = frame_->document(); const WebURL& url = document.baseURL(); if (!url.isNull()) { @@ -199,12 +183,11 @@ CefString CefDOMDocumentImpl::GetBaseURL() return str; } -CefString CefDOMDocumentImpl::GetCompleteURL(const CefString& partialURL) -{ +CefString CefDOMDocumentImpl::GetCompleteURL(const CefString& partialURL) { CefString str; if (!VerifyContext()) return str; - + const WebDocument& document = frame_->document(); const WebURL& url = document.completeURL(string16(partialURL)); if (!url.isNull()) { @@ -216,8 +199,7 @@ CefString CefDOMDocumentImpl::GetCompleteURL(const CefString& partialURL) } CefRefPtr CefDOMDocumentImpl::GetOrCreateNode( - const WebKit::WebNode& node) -{ + const WebKit::WebNode& node) { if (!VerifyContext()) return NULL; @@ -238,8 +220,7 @@ CefRefPtr CefDOMDocumentImpl::GetOrCreateNode( return nodeImpl; } -void CefDOMDocumentImpl::RemoveNode(const WebKit::WebNode& node) -{ +void CefDOMDocumentImpl::RemoveNode(const WebKit::WebNode& node) { if (!VerifyContext()) return; @@ -250,8 +231,7 @@ void CefDOMDocumentImpl::RemoveNode(const WebKit::WebNode& node) } } -void CefDOMDocumentImpl::Detach() -{ +void CefDOMDocumentImpl::Detach() { if (!VerifyContext()) return; @@ -261,7 +241,7 @@ void CefDOMDocumentImpl::Detach() // If you hit this assert it means that you are keeping references to this // document object beyond the valid scope. - DCHECK(GetRefCt() == 1); + DCHECK_EQ(GetRefCt(), 1); if (!node_map_.empty()) { NodeMap::const_iterator it = node_map_.begin(); @@ -273,9 +253,8 @@ void CefDOMDocumentImpl::Detach() frame_ = NULL; } -bool CefDOMDocumentImpl::VerifyContext() -{ - if(!CefThread::CurrentlyOn(CefThread::UI) || frame_ == NULL) { +bool CefDOMDocumentImpl::VerifyContext() { + if (!CefThread::CurrentlyOn(CefThread::UI) || frame_ == NULL) { NOTREACHED(); return false; } diff --git a/libcef/dom_document_impl.h b/libcef/dom_document_impl.h index dadedd26e..54296ac31 100644 --- a/libcef/dom_document_impl.h +++ b/libcef/dom_document_impl.h @@ -2,11 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _DOM_DOCUMENT_IMPL_H -#define _DOM_DOCUMENT_IMPL_H +#ifndef CEF_LIBCEF_DOM_DOCUMENT_IMPL_H_ +#define CEF_LIBCEF_DOM_DOCUMENT_IMPL_H_ +#pragma once -#include "include/cef_dom.h" #include +#include "include/cef_dom.h" namespace WebKit { class WebFrame; @@ -15,9 +16,8 @@ class WebNode; class CefBrowserImpl; -class CefDOMDocumentImpl : public CefDOMDocument -{ -public: +class CefDOMDocumentImpl : public CefDOMDocument { + public: CefDOMDocumentImpl(CefBrowserImpl* browser, WebKit::WebFrame* frame); virtual ~CefDOMDocumentImpl(); @@ -52,14 +52,14 @@ public: // Verify that the object exists and is being accessed on the UI thread. bool VerifyContext(); -protected: + protected: CefBrowserImpl* browser_; WebKit::WebFrame* frame_; - typedef std::map NodeMap; + typedef std::map NodeMap; NodeMap node_map_; IMPLEMENT_REFCOUNTING(CefDOMDocumentImpl); }; -#endif // _DOM_DOCUMENT_IMPL_H +#endif // CEF_LIBCEF_DOM_DOCUMENT_IMPL_H_ diff --git a/libcef/dom_event_impl.cc b/libcef/dom_event_impl.cc index 7913084d6..8be8a6eb5 100644 --- a/libcef/dom_event_impl.cc +++ b/libcef/dom_event_impl.cc @@ -2,9 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "dom_event_impl.h" -#include "cef_thread.h" -#include "dom_document_impl.h" +#include "libcef/dom_event_impl.h" +#include "libcef/cef_thread.h" +#include "libcef/dom_document_impl.h" #include "base/logging.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" @@ -16,19 +16,17 @@ using WebKit::WebString; CefDOMEventImpl::CefDOMEventImpl(CefRefPtr document, const WebKit::WebDOMEvent& event) - : document_(document), event_(event) -{ + : document_(document), + event_(event) { DCHECK(!event_.isNull()); } -CefDOMEventImpl::~CefDOMEventImpl() -{ +CefDOMEventImpl::~CefDOMEventImpl() { REQUIRE_UIT(); DCHECK(event_.isNull()); } -CefString CefDOMEventImpl::GetType() -{ +CefString CefDOMEventImpl::GetType() { CefString str; if (!VerifyContext()) return str; @@ -40,8 +38,7 @@ CefString CefDOMEventImpl::GetType() return str; } -CefDOMEventImpl::Category CefDOMEventImpl::GetCategory() -{ +CefDOMEventImpl::Category CefDOMEventImpl::GetCategory() { if (!VerifyContext()) return DOM_EVENT_CATEGORY_UNKNOWN; @@ -88,8 +85,7 @@ CefDOMEventImpl::Category CefDOMEventImpl::GetCategory() return static_cast(flags); } -CefDOMEventImpl::Phase CefDOMEventImpl::GetPhase() -{ +CefDOMEventImpl::Phase CefDOMEventImpl::GetPhase() { if (!VerifyContext()) return DOM_EVENT_PHASE_UNKNOWN; @@ -105,65 +101,58 @@ CefDOMEventImpl::Phase CefDOMEventImpl::GetPhase() return DOM_EVENT_PHASE_UNKNOWN; } -bool CefDOMEventImpl::CanBubble() -{ +bool CefDOMEventImpl::CanBubble() { if (!VerifyContext()) return false; return event_.bubbles(); } -bool CefDOMEventImpl::CanCancel() -{ +bool CefDOMEventImpl::CanCancel() { if (!VerifyContext()) return false; return event_.cancelable(); } -CefRefPtr CefDOMEventImpl::GetDocument() -{ +CefRefPtr CefDOMEventImpl::GetDocument() { if (!VerifyContext()) return NULL; return document_.get(); } -CefRefPtr CefDOMEventImpl::GetTarget() -{ +CefRefPtr CefDOMEventImpl::GetTarget() { if (!VerifyContext()) return NULL; return document_->GetOrCreateNode(event_.target()); } -CefRefPtr CefDOMEventImpl::GetCurrentTarget() -{ +CefRefPtr CefDOMEventImpl::GetCurrentTarget() { if (!VerifyContext()) return NULL; return document_->GetOrCreateNode(event_.currentTarget()); } -void CefDOMEventImpl::Detach() -{ +void CefDOMEventImpl::Detach() { // If you hit this assert it means that you are keeping references to this // event object beyond the valid scope. - DCHECK(GetRefCt() == 1); + DCHECK_EQ(GetRefCt(), 1); document_ = NULL; event_.assign(WebDOMEvent()); } -bool CefDOMEventImpl::VerifyContext() -{ +bool CefDOMEventImpl::VerifyContext() { if (!document_.get()) { NOTREACHED(); return false; } if (!document_->VerifyContext()) return false; - if(event_.isNull()) { + if (event_.isNull()) { NOTREACHED(); return false; } diff --git a/libcef/dom_event_impl.h b/libcef/dom_event_impl.h index 870523af4..4b57af4bb 100644 --- a/libcef/dom_event_impl.h +++ b/libcef/dom_event_impl.h @@ -2,21 +2,21 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _DOM_EVENT_IMPL_H -#define _DOM_EVENT_IMPL_H +#ifndef CEF_LIBCEF_DOM_EVENT_IMPL_H_ +#define CEF_LIBCEF_DOM_EVENT_IMPL_H_ +#pragma once #include "include/cef_dom.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" class CefDOMDocumentImpl; -class CefDOMEventImpl : public CefDOMEvent -{ -public: +class CefDOMEventImpl : public CefDOMEvent { + public: CefDOMEventImpl(CefRefPtr document, const WebKit::WebDOMEvent& event); virtual ~CefDOMEventImpl(); - + virtual CefString GetType() OVERRIDE; virtual Category GetCategory() OVERRIDE; virtual Phase GetPhase() OVERRIDE; @@ -32,11 +32,11 @@ public: // Verify that the object exists and is being accessed on the UI thread. bool VerifyContext(); -protected: + protected: CefRefPtr document_; WebKit::WebDOMEvent event_; IMPLEMENT_REFCOUNTING(CefDOMEventImpl); }; -#endif // _DOM_EVENT_IMPL_H +#endif // CEF_LIBCEF_DOM_EVENT_IMPL_H_ diff --git a/libcef/dom_node_impl.cc b/libcef/dom_node_impl.cc index ca0b580ac..45cb03fb7 100644 --- a/libcef/dom_node_impl.cc +++ b/libcef/dom_node_impl.cc @@ -2,12 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "dom_node_impl.h" -#include "browser_impl.h" -#include "cef_thread.h" -#include "dom_document_impl.h" -#include "dom_event_impl.h" -#include "tracker.h" +#include "libcef/dom_node_impl.h" +#include "libcef/browser_impl.h" +#include "libcef/cef_thread.h" +#include "libcef/dom_document_impl.h" +#include "libcef/dom_event_impl.h" +#include "libcef/tracker.h" #include "base/logging.h" #include "base/string_util.h" @@ -38,31 +38,28 @@ using WebKit::WebNode; using WebKit::WebSelectElement; using WebKit::WebString; - namespace { // Wrapper implementation for WebDOMEventListener. class CefDOMEventListenerWrapper : public WebDOMEventListener, - public CefTrackObject -{ -public: + public CefTrackObject { + public: CefDOMEventListenerWrapper(CefBrowserImpl* browser, WebFrame* frame, CefRefPtr listener) - : browser_(browser), frame_(frame), listener_(listener) - { + : browser_(browser), + frame_(frame), + listener_(listener) { // Cause this object to be deleted immediately before the frame is closed. browser->UIT_AddFrameObject(frame, this); } - virtual ~CefDOMEventListenerWrapper() - { + virtual ~CefDOMEventListenerWrapper() { REQUIRE_UIT(); } - virtual void handleEvent(const WebDOMEvent& event) - { + virtual void handleEvent(const WebDOMEvent& event) { CefRefPtr documentImpl; CefRefPtr eventImpl; - + if (!event.isNull()) { // Create CefDOMDocumentImpl and CefDOMEventImpl objects that are valid // only for the scope of this method. @@ -72,32 +69,31 @@ public: eventImpl = new CefDOMEventImpl(documentImpl, event); } } - + listener_->HandleEvent(eventImpl.get()); - - if(eventImpl.get()) + + if (eventImpl.get()) eventImpl->Detach(); if (documentImpl.get()) documentImpl->Detach(); } -protected: + protected: CefBrowserImpl* browser_; WebFrame* frame_; CefRefPtr listener_; }; -} // namespace +} // namespace CefDOMNodeImpl::CefDOMNodeImpl(CefRefPtr document, const WebKit::WebNode& node) - : document_(document), node_(node) -{ + : document_(document), + node_(node) { } -CefDOMNodeImpl::~CefDOMNodeImpl() -{ +CefDOMNodeImpl::~CefDOMNodeImpl() { REQUIRE_UIT(); if (document_.get() && !node_.isNull()) { @@ -106,8 +102,7 @@ CefDOMNodeImpl::~CefDOMNodeImpl() } } -CefDOMNodeImpl::Type CefDOMNodeImpl::GetType() -{ +CefDOMNodeImpl::Type CefDOMNodeImpl::GetType() { if (!VerifyContext()) return DOM_NODE_TYPE_UNSUPPORTED; @@ -143,24 +138,21 @@ CefDOMNodeImpl::Type CefDOMNodeImpl::GetType() } } -bool CefDOMNodeImpl::IsText() -{ +bool CefDOMNodeImpl::IsText() { if (!VerifyContext()) return false; return node_.isTextNode(); } -bool CefDOMNodeImpl::IsElement() -{ +bool CefDOMNodeImpl::IsElement() { if (!VerifyContext()) return false; return node_.isElementNode(); } -bool CefDOMNodeImpl::IsFormControlElement() -{ +bool CefDOMNodeImpl::IsFormControlElement() { if (!VerifyContext()) return false; @@ -172,8 +164,7 @@ bool CefDOMNodeImpl::IsFormControlElement() return false; } -CefString CefDOMNodeImpl::GetFormControlElementType() -{ +CefString CefDOMNodeImpl::GetFormControlElementType() { CefString str; if (!VerifyContext()) return str; @@ -193,8 +184,7 @@ CefString CefDOMNodeImpl::GetFormControlElementType() return str; } -bool CefDOMNodeImpl::IsSame(CefRefPtr that) -{ +bool CefDOMNodeImpl::IsSame(CefRefPtr that) { if (!VerifyContext()) return false; @@ -205,8 +195,7 @@ bool CefDOMNodeImpl::IsSame(CefRefPtr that) return node_.equals(impl->node_); } -CefString CefDOMNodeImpl::GetName() -{ +CefString CefDOMNodeImpl::GetName() { CefString str; if (!VerifyContext()) return str; @@ -218,8 +207,7 @@ CefString CefDOMNodeImpl::GetName() return str; } -CefString CefDOMNodeImpl::GetValue() -{ +CefString CefDOMNodeImpl::GetValue() { CefString str; if (!VerifyContext()) return str; @@ -257,8 +245,7 @@ CefString CefDOMNodeImpl::GetValue() return str; } -bool CefDOMNodeImpl::SetValue(const CefString& value) -{ +bool CefDOMNodeImpl::SetValue(const CefString& value) { if (!VerifyContext()) return false; @@ -268,8 +255,7 @@ bool CefDOMNodeImpl::SetValue(const CefString& value) return node_.setNodeValue(string16(value)); } -CefString CefDOMNodeImpl::GetAsMarkup() -{ +CefString CefDOMNodeImpl::GetAsMarkup() { CefString str; if (!VerifyContext()) return str; @@ -281,56 +267,49 @@ CefString CefDOMNodeImpl::GetAsMarkup() return str; } -CefRefPtr CefDOMNodeImpl::GetDocument() -{ +CefRefPtr CefDOMNodeImpl::GetDocument() { if (!VerifyContext()) return NULL; return document_.get(); } -CefRefPtr CefDOMNodeImpl::GetParent() -{ +CefRefPtr CefDOMNodeImpl::GetParent() { if (!VerifyContext()) return NULL; return document_->GetOrCreateNode(node_.parentNode()); } -CefRefPtr CefDOMNodeImpl::GetPreviousSibling() -{ +CefRefPtr CefDOMNodeImpl::GetPreviousSibling() { if (!VerifyContext()) return NULL; return document_->GetOrCreateNode(node_.previousSibling()); } -CefRefPtr CefDOMNodeImpl::GetNextSibling() -{ +CefRefPtr CefDOMNodeImpl::GetNextSibling() { if (!VerifyContext()) return NULL; return document_->GetOrCreateNode(node_.nextSibling()); } -bool CefDOMNodeImpl::HasChildren() -{ +bool CefDOMNodeImpl::HasChildren() { if (!VerifyContext()) return false; return node_.hasChildNodes(); } -CefRefPtr CefDOMNodeImpl::GetFirstChild() -{ +CefRefPtr CefDOMNodeImpl::GetFirstChild() { if (!VerifyContext()) return NULL; return document_->GetOrCreateNode(node_.firstChild()); } -CefRefPtr CefDOMNodeImpl::GetLastChild() -{ +CefRefPtr CefDOMNodeImpl::GetLastChild() { if (!VerifyContext()) return NULL; @@ -339,8 +318,7 @@ CefRefPtr CefDOMNodeImpl::GetLastChild() void CefDOMNodeImpl::AddEventListener(const CefString& eventType, CefRefPtr listener, - bool useCapture) -{ + bool useCapture) { if (!VerifyContext()) return; @@ -350,8 +328,7 @@ void CefDOMNodeImpl::AddEventListener(const CefString& eventType, useCapture); } -CefString CefDOMNodeImpl::GetElementTagName() -{ +CefString CefDOMNodeImpl::GetElementTagName() { CefString str; if (!VerifyContext()) return str; @@ -369,8 +346,7 @@ CefString CefDOMNodeImpl::GetElementTagName() return str; } -bool CefDOMNodeImpl::HasElementAttributes() -{ +bool CefDOMNodeImpl::HasElementAttributes() { if (!VerifyContext()) return false; @@ -383,8 +359,7 @@ bool CefDOMNodeImpl::HasElementAttributes() return (element.attributes().length() > 0); } -bool CefDOMNodeImpl::HasElementAttribute(const CefString& attrName) -{ +bool CefDOMNodeImpl::HasElementAttribute(const CefString& attrName) { if (!VerifyContext()) return false; @@ -397,8 +372,7 @@ bool CefDOMNodeImpl::HasElementAttribute(const CefString& attrName) return element.hasAttribute(string16(attrName)); } -CefString CefDOMNodeImpl::GetElementAttribute(const CefString& attrName) -{ +CefString CefDOMNodeImpl::GetElementAttribute(const CefString& attrName) { CefString str; if (!VerifyContext()) return str; @@ -416,8 +390,7 @@ CefString CefDOMNodeImpl::GetElementAttribute(const CefString& attrName) return str; } -void CefDOMNodeImpl::GetElementAttributes(AttributeMap& attrMap) -{ +void CefDOMNodeImpl::GetElementAttributes(AttributeMap& attrMap) { if (!VerifyContext()) return; @@ -449,8 +422,7 @@ void CefDOMNodeImpl::GetElementAttributes(AttributeMap& attrMap) } bool CefDOMNodeImpl::SetElementAttribute(const CefString& attrName, - const CefString& value) -{ + const CefString& value) { if (!VerifyContext()) return false; @@ -463,8 +435,7 @@ bool CefDOMNodeImpl::SetElementAttribute(const CefString& attrName, return element.setAttribute(string16(attrName), string16(value)); } -CefString CefDOMNodeImpl::GetElementInnerText() -{ +CefString CefDOMNodeImpl::GetElementInnerText() { CefString str; if (!VerifyContext()) return str; @@ -482,21 +453,19 @@ CefString CefDOMNodeImpl::GetElementInnerText() return str; } -void CefDOMNodeImpl::Detach() -{ +void CefDOMNodeImpl::Detach() { document_ = NULL; node_.assign(WebNode()); } -bool CefDOMNodeImpl::VerifyContext() -{ +bool CefDOMNodeImpl::VerifyContext() { if (!document_.get()) { NOTREACHED(); return false; } if (!document_->VerifyContext()) return false; - if(node_.isNull()) { + if (node_.isNull()) { NOTREACHED(); return false; } diff --git a/libcef/dom_node_impl.h b/libcef/dom_node_impl.h index c936f3039..e98d1d2b1 100644 --- a/libcef/dom_node_impl.h +++ b/libcef/dom_node_impl.h @@ -2,17 +2,17 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _DOM_NODE_IMPL_H -#define _DOM_NODE_IMPL_H +#ifndef CEF_LIBCEF_DOM_NODE_IMPL_H_ +#define CEF_LIBCEF_DOM_NODE_IMPL_H_ +#pragma once #include "include/cef_dom.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" class CefDOMDocumentImpl; -class CefDOMNodeImpl : public CefDOMNode -{ -public: +class CefDOMNodeImpl : public CefDOMNode { + public: CefDOMNodeImpl(CefRefPtr document, const WebKit::WebNode& node); virtual ~CefDOMNodeImpl(); @@ -52,11 +52,11 @@ public: // Verify that the object exists and is being accessed on the UI thread. bool VerifyContext(); -protected: + protected: CefRefPtr document_; WebKit::WebNode node_; IMPLEMENT_REFCOUNTING(CefDOMNodeImpl); }; -#endif // _DOM_NODE_IMPL_H +#endif // CEF_LIBCEF_DOM_NODE_IMPL_H_ diff --git a/libcef/dom_storage_area.cc b/libcef/dom_storage_area.cc index 6b8e86a21..f4b528854 100644 --- a/libcef/dom_storage_area.cc +++ b/libcef/dom_storage_area.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "dom_storage_area.h" -#include "dom_storage_context.h" -#include "dom_storage_namespace.h" +#include "libcef/dom_storage_area.h" +#include "libcef/dom_storage_context.h" +#include "libcef/dom_storage_namespace.h" #include "base/task.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" diff --git a/libcef/dom_storage_area.h b/libcef/dom_storage_area.h index 8c8b7d81b..b49a0d131 100644 --- a/libcef/dom_storage_area.h +++ b/libcef/dom_storage_area.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DOM_STORAGE_AREA_H -#define _DOM_STORAGE_AREA_H +#ifndef CEF_LIBCEF_DOM_STORAGE_AREA_H_ +#define CEF_LIBCEF_DOM_STORAGE_AREA_H_ #pragma once #include "base/hash_tables.h" @@ -72,4 +72,4 @@ struct hash { } // namespace __gnu_cxx #endif -#endif // _DOM_STORAGE_AREA_H +#endif // CEF_LIBCEF_DOM_STORAGE_AREA_H_ diff --git a/libcef/dom_storage_common.h b/libcef/dom_storage_common.h index 3fcf4aa1b..609129c5a 100644 --- a/libcef/dom_storage_common.h +++ b/libcef/dom_storage_common.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DOM_STORAGE_COMMON_H -#define _DOM_STORAGE_COMMON_H +#ifndef CEF_LIBCEF_DOM_STORAGE_COMMON_H_ +#define CEF_LIBCEF_DOM_STORAGE_COMMON_H_ +#pragma once #include "base/basictypes.h" @@ -15,4 +16,4 @@ enum DOMStorageType { DOM_STORAGE_SESSION }; -#endif // _DOM_STORAGE_COMMON_H +#endif // CEF_LIBCEF_DOM_STORAGE_COMMON_H_ diff --git a/libcef/dom_storage_context.cc b/libcef/dom_storage_context.cc index 9cba7c631..aa27106e4 100644 --- a/libcef/dom_storage_context.cc +++ b/libcef/dom_storage_context.cc @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "dom_storage_context.h" -#include "cef_thread.h" -#include "dom_storage_namespace.h" +#include "libcef/dom_storage_context.h" #include +#include "libcef/cef_thread.h" +#include "libcef/dom_storage_area.h" +#include "libcef/dom_storage_namespace.h" + #include "base/bind.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/string_util.h" -#include "dom_storage_area.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" @@ -35,7 +36,8 @@ DOMStorageContext::DOMStorageContext(const FilePath& local_storage_path) : local_storage_path_(local_storage_path), last_storage_area_id_(0), last_session_storage_namespace_id_on_ui_thread_(kLocalStorageNamespaceId), - last_session_storage_namespace_id_on_io_thread_(kLocalStorageNamespaceId){ + last_session_storage_namespace_id_on_io_thread_( + kLocalStorageNamespaceId) { } DOMStorageContext::~DOMStorageContext() { @@ -176,7 +178,7 @@ void DOMStorageContext::DeleteDataModifiedSince( void DOMStorageContext::DeleteLocalStorageForOrigin(const string16& origin) { DCHECK(CefThread::CurrentlyOn(CefThread::UI)); - + DOMStorageArea* area = GetStorageArea(kLocalStorageNamespaceId, origin, false); if (!area) @@ -188,7 +190,7 @@ void DOMStorageContext::DeleteLocalStorageForOrigin(const string16& origin) { if (local_storage_path_.empty()) return; - + FilePath file_path = GetLocalStorageFilePath(origin); if (!file_path.empty()) file_util::Delete(file_path, false); @@ -217,7 +219,7 @@ void DOMStorageContext::DeleteAllLocalStorageFiles() { void DOMStorageContext::SetLocalStoragePath( const FilePath& local_storage_path) { DCHECK(CefThread::CurrentlyOn(CefThread::UI)); - + if ((local_storage_path.empty() && local_storage_path_.empty()) || local_storage_path == local_storage_path_) return; @@ -291,7 +293,7 @@ void DOMStorageContext::ClearLocalState(const FilePath& profile_path, FilePath DOMStorageContext::GetLocalStorageFilePath( const string16& origin) const { DCHECK(!local_storage_path_.empty()); - + string16 origin_id = webkit_database::DatabaseUtil::GetOriginIdentifier(GURL(origin)); diff --git a/libcef/dom_storage_context.h b/libcef/dom_storage_context.h index f8254bd70..819f5a7c6 100644 --- a/libcef/dom_storage_context.h +++ b/libcef/dom_storage_context.h @@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DOM_STORAGE_CONTEXT_H -#define _DOM_STORAGE_CONTEXT_H +#ifndef CEF_LIBCEF_DOM_STORAGE_CONTEXT_H_ +#define CEF_LIBCEF_DOM_STORAGE_CONTEXT_H_ +#pragma once #include #include +#include #include "base/file_path.h" #include "base/string16.h" @@ -24,7 +26,7 @@ class DOMStorageNamespace; // NOTE: Virtual methods facilitate mocking functions for testing. class DOMStorageContext { public: - DOMStorageContext(const FilePath& local_storage_path); + explicit DOMStorageContext(const FilePath& local_storage_path); virtual ~DOMStorageContext(); // Allocate a new storage area id. Only call on the WebKit thread. @@ -145,4 +147,4 @@ class DOMStorageContext { static unsigned int session_storage_quota_; }; -#endif // _DOM_STORAGE_CONTEXT_H +#endif // CEF_LIBCEF_DOM_STORAGE_CONTEXT_H_ diff --git a/libcef/dom_storage_namespace.cc b/libcef/dom_storage_namespace.cc index 02d60c43c..1f140202e 100644 --- a/libcef/dom_storage_namespace.cc +++ b/libcef/dom_storage_namespace.cc @@ -2,9 +2,9 @@ // source code is governed by a BSD-style license that can be found in the // LICENSE file. -#include "dom_storage_namespace.h" -#include "dom_storage_area.h" -#include "dom_storage_context.h" +#include "libcef/dom_storage_namespace.h" +#include "libcef/dom_storage_area.h" +#include "libcef/dom_storage_context.h" #include "base/file_path.h" #include "base/logging.h" diff --git a/libcef/dom_storage_namespace.h b/libcef/dom_storage_namespace.h index 124b0ea93..406d7db84 100644 --- a/libcef/dom_storage_namespace.h +++ b/libcef/dom_storage_namespace.h @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DOM_STORAGE_NAMESPACE_H -#define _DOM_STORAGE_NAMESPACE_H +#ifndef CEF_LIBCEF_DOM_STORAGE_NAMESPACE_H_ +#define CEF_LIBCEF_DOM_STORAGE_NAMESPACE_H_ +#pragma once -#include "dom_storage_common.h" +#include "libcef/dom_storage_common.h" + +#include #include "base/hash_tables.h" #include "base/memory/scoped_ptr.h" @@ -62,7 +65,8 @@ class DOMStorageNamespace { void CreateWebStorageNamespaceIfNecessary(); // All the storage areas we own. - typedef base::hash_map OriginToStorageAreaMap; + typedef base::hash_map OriginToStorageAreaMap; OriginToStorageAreaMap origin_to_storage_area_; // The DOMStorageContext that owns us. @@ -84,4 +88,4 @@ class DOMStorageNamespace { DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageNamespace); }; -#endif // _DOM_STORAGE_NAMESPACE_H +#endif // CEF_LIBCEF_DOM_STORAGE_NAMESPACE_H_ diff --git a/libcef/download_util.cc b/libcef/download_util.cc index d7d13ba93..28831ab92 100644 --- a/libcef/download_util.cc +++ b/libcef/download_util.cc @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "download_util.h" +#include "libcef/download_util.h" #include "base/file_path.h" #include "base/string16.h" @@ -24,26 +24,26 @@ namespace { // From chrome/browser/download/download_util.cc bool IsShellIntegratedExtension(const string16& extension) { string16 extension_lower = StringToLowerASCII(extension); - + static const wchar_t* const integrated_extensions[] = { // See . L"local", // Right-clicking on shortcuts can be magical. L"lnk", }; - + for (int i = 0; i < arraysize(integrated_extensions); ++i) { if (extension_lower == integrated_extensions[i]) return true; } - + // See . // That vulnerability report is not exactly on point, but files become magical // if their end in a CLSID. Here we block extensions that look like CLSIDs. if (extension_lower.size() > 0 && extension_lower.at(0) == L'{' && extension_lower.at(extension_lower.length() - 1) == L'}') return true; - + return false; } @@ -62,7 +62,7 @@ bool IsReservedName(const string16& filename) { L"lpt5", L"lpt6", L"lpt7", L"lpt8", L"lpt9", L"clock$" }; string16 filename_lower = StringToLowerASCII(filename); - + for (int i = 0; i < arraysize(known_devices); ++i) { // Exact match. if (filename_lower == known_devices[i]) @@ -71,18 +71,18 @@ bool IsReservedName(const string16& filename) { if (filename_lower.find(string16(known_devices[i]) + L".") == 0) return true; } - + static const wchar_t* const magic_names[] = { // These file names are used by the "Customize folder" feature of the shell. L"desktop.ini", L"thumbs.db", }; - + for (int i = 0; i < arraysize(magic_names); ++i) { if (filename_lower == magic_names[i]) return true; } - + return false; } #endif // OS_WIN @@ -100,21 +100,21 @@ void GenerateExtension(const FilePath& file_name, // 2) Shell integration. Some file extensions automatically integrate with // the shell. We block these extensions to prevent a malicious web site // from integrating with the user's shell. - + // See if our file name already contains an extension. FilePath::StringType extension = file_name.Extension(); if (!extension.empty()) extension.erase(extension.begin()); // Erase preceding '.'. - + #if defined(OS_WIN) static const FilePath::CharType default_extension[] = FILE_PATH_LITERAL("download"); - + // Rename shell-integrated extensions. if (IsShellIntegratedExtension(extension)) extension.assign(default_extension); #endif - + if (extension.empty()) { // The GetPreferredExtensionForMimeType call will end up going to disk. Do // this on another thread to avoid slowing the IO thread. @@ -122,7 +122,7 @@ void GenerateExtension(const FilePath& file_name, base::ThreadRestrictions::ScopedAllowIO allow_io; net::GetPreferredExtensionForMimeType(mime_type, &extension); } - + generated_extension->swap(extension); } @@ -135,7 +135,7 @@ void GenerateSafeFileName(const std::string& mime_type, FilePath* file_name) { FilePath::StringType extension; GenerateExtension(*file_name, mime_type, &extension); *file_name = file_name->ReplaceExtension(extension); - + #if defined(OS_WIN) // Prepend "_" to the file name if it's a reserved name FilePath::StringType leaf_name = file_name->BaseName().value(); @@ -151,8 +151,8 @@ void GenerateSafeFileName(const std::string& mime_type, FilePath* file_name) { } #endif } - -} // namespace + +} // namespace namespace download_util { @@ -170,7 +170,7 @@ void GenerateFileName(const GURL& url, suggested_name, mime_type, "download"); - + // TODO(evan): this code is totally wrong -- we should just generate // Unicode filenames and do all this encoding switching at the end. // However, I'm just shuffling wrong code around, at least not adding @@ -180,10 +180,10 @@ void GenerateFileName(const GURL& url, #else *generated_name = FilePath(base::SysWideToNativeMB(UTF16ToWide(new_name))); #endif - + DCHECK(!generated_name->empty()); - + GenerateSafeFileName(mime_type, generated_name); } -} // namespace download_util +} // namespace download_util diff --git a/libcef/download_util.h b/libcef/download_util.h index a9701eaa2..c2d45afe5 100644 --- a/libcef/download_util.h +++ b/libcef/download_util.h @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DOWNLOAD_UTIL_H -#define _DOWNLOAD_UTIL_H +#ifndef CEF_LIBCEF_DOWNLOAD_UTIL_H_ +#define CEF_LIBCEF_DOWNLOAD_UTIL_H_ #pragma once #include @@ -22,6 +22,6 @@ void GenerateFileName(const GURL& url, const std::string& suggested_name, FilePath* generated_name); -} // namespace download_util +} // namespace download_util -#endif // _DOWNLOAD_UTIL_H +#endif // CEF_LIBCEF_DOWNLOAD_UTIL_H_ diff --git a/libcef/drag_data_impl.cc b/libcef/drag_data_impl.cc index 0cf1559b3..d80dd9833 100644 --- a/libcef/drag_data_impl.cc +++ b/libcef/drag_data_impl.cc @@ -2,71 +2,58 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "drag_data_impl.h" +#include "libcef/drag_data_impl.h" CefDragDataImpl::CefDragDataImpl(const WebDropData& data) - : data_(data) -{ + : data_(data) { } - -bool CefDragDataImpl::IsLink() -{ + +bool CefDragDataImpl::IsLink() { return (data_.url.is_valid() && data_.file_extension.empty()); } -bool CefDragDataImpl::IsFragment() -{ +bool CefDragDataImpl::IsFragment() { return (!data_.url.is_valid() && data_.file_extension.empty() && data_.filenames.empty()); } -bool CefDragDataImpl::IsFile() -{ +bool CefDragDataImpl::IsFile() { return (!data_.file_extension.empty() || !data_.filenames.empty()); } -CefString CefDragDataImpl::GetLinkURL() -{ +CefString CefDragDataImpl::GetLinkURL() { return data_.url.spec(); } -CefString CefDragDataImpl::GetLinkTitle() -{ +CefString CefDragDataImpl::GetLinkTitle() { return data_.url_title; } -CefString CefDragDataImpl::GetLinkMetadata() -{ +CefString CefDragDataImpl::GetLinkMetadata() { return data_.download_metadata; } -CefString CefDragDataImpl::GetFragmentText() -{ +CefString CefDragDataImpl::GetFragmentText() { return data_.plain_text; } -CefString CefDragDataImpl::GetFragmentHtml() -{ +CefString CefDragDataImpl::GetFragmentHtml() { return data_.text_html; } -CefString CefDragDataImpl::GetFragmentBaseURL() -{ +CefString CefDragDataImpl::GetFragmentBaseURL() { return data_.html_base_url.spec(); } -CefString CefDragDataImpl::GetFileExtension() -{ +CefString CefDragDataImpl::GetFileExtension() { return data_.file_extension; } -CefString CefDragDataImpl::GetFileName() -{ +CefString CefDragDataImpl::GetFileName() { return data_.file_description_filename; } -bool CefDragDataImpl::GetFileNames(std::vector& names) -{ +bool CefDragDataImpl::GetFileNames(std::vector& names) { if (data_.filenames.empty()) return false; diff --git a/libcef/drag_data_impl.h b/libcef/drag_data_impl.h index 438b7a313..2dd30ec8e 100644 --- a/libcef/drag_data_impl.h +++ b/libcef/drag_data_impl.h @@ -2,16 +2,18 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _DRAG_DATA_IMPL_H -#define _DRAG_DATA_IMPL_H +#ifndef CEF_LIBCEF_DRAG_DATA_IMPL_H_ +#define CEF_LIBCEF_DRAG_DATA_IMPL_H_ +#pragma once + +#include #include "include/cef_drag_data.h" #include "webkit/glue/webdropdata.h" // Implementation of CefDragData. -class CefDragDataImpl : public CefDragData -{ -public: +class CefDragDataImpl : public CefDragData { + public: explicit CefDragDataImpl(const WebDropData& data); virtual bool IsLink(); @@ -27,10 +29,10 @@ public: virtual CefString GetFileName(); virtual bool GetFileNames(std::vector& names); -protected: + protected: WebDropData data_; IMPLEMENT_REFCOUNTING(CefDragDataImpl); }; -#endif // _DRAG_DATA_IMPL_H +#endif // CEF_LIBCEF_DRAG_DATA_IMPL_H_ diff --git a/libcef/drag_download_file.cc b/libcef/drag_download_file.cc index d02bf743a..c09d232a0 100644 --- a/libcef/drag_download_file.cc +++ b/libcef/drag_download_file.cc @@ -3,9 +3,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "drag_download_file.h" -#include "browser_impl.h" -#include "cef_thread.h" +#include "libcef/drag_download_file.h" +#include "libcef/browser_impl.h" +#include "libcef/cef_thread.h" #include "base/file_util.h" #include "base/message_loop.h" @@ -97,8 +97,9 @@ void DragDownloadFile::InitiateDownload() { } #endif - // TODO: You seem to have found an example of HTML5 drag and drop download. - // Please report it to the CEF developers so that we can add support for it. + // TODO(cef): You seem to have found an example of HTML5 drag and drop + // download. Please report it to the CEF developers so that we can add support + // for it. NOTREACHED(); bool is_successful = false; DownloadCompleted(is_successful); diff --git a/libcef/drag_download_file.h b/libcef/drag_download_file.h index 1a03a3993..7640176ee 100644 --- a/libcef/drag_download_file.h +++ b/libcef/drag_download_file.h @@ -3,10 +3,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DRAG_DOWNLOAD_FILE_H -#define _DRAG_DOWNLOAD_FILE_H +#ifndef CEF_LIBCEF_DRAG_DOWNLOAD_FILE_H_ +#define CEF_LIBCEF_DRAG_DOWNLOAD_FILE_H_ #pragma once +#include + #include "base/file_path.h" #include "base/memory/linked_ptr.h" #include "base/message_loop.h" @@ -93,4 +95,4 @@ class DragDownloadFile : public ui::DownloadFileProvider { DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); }; -#endif // _DRAG_DOWNLOAD_FILE_H +#endif // CEF_LIBCEF_DRAG_DOWNLOAD_FILE_H_ diff --git a/libcef/drag_download_util.cc b/libcef/drag_download_util.cc index ae7168611..66534e233 100644 --- a/libcef/drag_download_util.cc +++ b/libcef/drag_download_util.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cef_thread.h" -#include "drag_download_util.h" +#include "libcef/cef_thread.h" +#include "libcef/drag_download_util.h" #include "base/string_util.h" #include "base/file_path.h" @@ -65,11 +65,11 @@ FileStream* CreateFileStreamForDrop(FilePath* file_path) { if (seq == 0) { new_file_path = *file_path; } else { - #if defined(OS_WIN) +#if defined(OS_WIN) string16 suffix = ASCIIToUTF16("-") + base::IntToString16(seq); - #else +#else std::string suffix = std::string("-") + base::IntToString(seq); - #endif +#endif new_file_path = file_path->InsertBeforeExtension(suffix); } diff --git a/libcef/drag_download_util.h b/libcef/drag_download_util.h index 86450e575..e698ffc09 100644 --- a/libcef/drag_download_util.h +++ b/libcef/drag_download_util.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _DRAG_DOWNLOAD_UTIL_H -#define _DRAG_DOWNLOAD_UTIL_H +#ifndef CEF_LIBCEF_DRAG_DOWNLOAD_UTIL_H_ +#define CEF_LIBCEF_DRAG_DOWNLOAD_UTIL_H_ #pragma once -#include "drag_download_file.h" +#include "libcef/drag_download_file.h" #include "base/basictypes.h" #include "base/memory/ref_counted.h" @@ -60,4 +60,4 @@ class PromiseFileFinalizer : public ui::DownloadFileObserver { } // namespace drag_download_util -#endif // _DRAG_DOWNLOAD_UTIL_H +#endif // CEF_LIBCEF_DRAG_DOWNLOAD_UTIL_H_ diff --git a/libcef/external_popup_menu_mac.h b/libcef/external_popup_menu_mac.h index 349e89e8e..7beb29096 100644 --- a/libcef/external_popup_menu_mac.h +++ b/libcef/external_popup_menu_mac.h @@ -3,8 +3,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _EXTERNAL_POPUP_MENU_MAC_H -#define _EXTERNAL_POPUP_MENU_MAC_H +#ifndef CEF_LIBCEF_EXTERNAL_POPUP_MENU_MAC_H_ +#define CEF_LIBCEF_EXTERNAL_POPUP_MENU_MAC_H_ +#pragma once #include "base/basictypes.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenu.h" @@ -34,4 +35,4 @@ class ExternalPopupMenu : public WebKit::WebExternalPopupMenu { DISALLOW_COPY_AND_ASSIGN(ExternalPopupMenu); }; -#endif // _EXTERNAL_POPUP_MENU_MAC_H +#endif // CEF_LIBCEF_EXTERNAL_POPUP_MENU_MAC_H_ diff --git a/libcef/external_popup_menu_mac.mm b/libcef/external_popup_menu_mac.mm index addd4f6b9..d92e7d69e 100644 --- a/libcef/external_popup_menu_mac.mm +++ b/libcef/external_popup_menu_mac.mm @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "external_popup_menu_mac.h" -#include "browser_impl.h" +#include "libcef/external_popup_menu_mac.h" +#include "libcef/browser_impl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebExternalPopupMenuClient.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" diff --git a/libcef/external_protocol_handler.h b/libcef/external_protocol_handler.h index 3b94a1ca8..67f94387b 100644 --- a/libcef/external_protocol_handler.h +++ b/libcef/external_protocol_handler.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _EXTERNAL_PROTOCOL_HANDLER_H -#define _EXTERNAL_PROTOCOL_HANDLER_H +#ifndef CEF_LIBCEF_EXTERNAL_PROTOCOL_HANDLER_H_ +#define CEF_LIBCEF_EXTERNAL_PROTOCOL_HANDLER_H_ +#pragma once #include @@ -17,6 +18,6 @@ bool HasExternalHandler(const std::string& scheme); // Pass handling of the specified |gurl| to the OS. bool HandleExternalProtocol(const GURL& gurl); -} // namespace ExternalProtocolHandler +} // namespace ExternalProtocolHandler -#endif // _EXTERNAL_PROTOCOL_HANDLER_H +#endif // CEF_LIBCEF_EXTERNAL_PROTOCOL_HANDLER_H_ diff --git a/libcef/external_protocol_handler_gtk.cc b/libcef/external_protocol_handler_gtk.cc index 4535f5427..7efb413eb 100644 --- a/libcef/external_protocol_handler_gtk.cc +++ b/libcef/external_protocol_handler_gtk.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "external_protocol_handler.h" +#include "libcef/external_protocol_handler.h" namespace ExternalProtocolHandler { @@ -14,4 +14,4 @@ bool HandleExternalProtocol(const GURL& gurl) { return false; } -} // namespace ExternalProtocolHandler +} // namespace ExternalProtocolHandler diff --git a/libcef/external_protocol_handler_mac.mm b/libcef/external_protocol_handler_mac.mm index 4535f5427..7efb413eb 100644 --- a/libcef/external_protocol_handler_mac.mm +++ b/libcef/external_protocol_handler_mac.mm @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "external_protocol_handler.h" +#include "libcef/external_protocol_handler.h" namespace ExternalProtocolHandler { @@ -14,4 +14,4 @@ bool HandleExternalProtocol(const GURL& gurl) { return false; } -} // namespace ExternalProtocolHandler +} // namespace ExternalProtocolHandler diff --git a/libcef/external_protocol_handler_win.cc b/libcef/external_protocol_handler_win.cc index c9266668e..12f3a3fce 100644 --- a/libcef/external_protocol_handler_win.cc +++ b/libcef/external_protocol_handler_win.cc @@ -2,14 +2,15 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "external_protocol_handler.h" +#include "libcef/external_protocol_handler.h" + +#include +#include #include "base/utf_string_conversions.h" #include "base/win/registry.h" #include "googleurl/src/gurl.h" -#include - namespace ExternalProtocolHandler { // According to Mozilla in uriloader/exthandler/win/nsOSHelperAppService.cpp: @@ -44,9 +45,9 @@ bool HandleExternalProtocol(const GURL& gurl) { if (address.length() > kMaxAddressLengthChars) return false; - ShellExecuteA(NULL, "open", address.c_str(), NULL, NULL, SW_SHOWNORMAL); + ShellExecuteA(NULL, "open", address.c_str(), NULL, NULL, SW_SHOWNORMAL); return true; } -} // namespace ExternalProtocolHandler +} // namespace ExternalProtocolHandler diff --git a/libcef/http_header_utils.cc b/libcef/http_header_utils.cc index bcf8e7e50..1fb4648a6 100644 --- a/libcef/http_header_utils.cc +++ b/libcef/http_header_utils.cc @@ -2,7 +2,7 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "http_header_utils.h" +#include "libcef/http_header_utils.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" @@ -10,19 +10,18 @@ using net::HttpResponseHeaders; namespace HttpHeaderUtils { -std::string GenerateHeaders(const HeaderMap& map) -{ +std::string GenerateHeaders(const HeaderMap& map) { std::string headers; - for(HeaderMap::const_iterator header = map.begin(); - header != map.end(); - ++header) { + for (HeaderMap::const_iterator header = map.begin(); + header != map.end(); + ++header) { const CefString& key = header->first; const CefString& value = header->second; - if(!key.empty()) { + if (!key.empty()) { // Delimit with "\r\n". - if(!headers.empty()) + if (!headers.empty()) headers += "\r\n"; headers += std::string(key) + ": " + std::string(value); @@ -32,8 +31,7 @@ std::string GenerateHeaders(const HeaderMap& map) return headers; } -void ParseHeaders(const std::string& header_str, HeaderMap& map) -{ +void ParseHeaders(const std::string& header_str, HeaderMap& map) { // Parse the request header values std::string headerStr = "HTTP/1.1 200 OK\n"; headerStr += header_str; @@ -42,8 +40,8 @@ void ParseHeaders(const std::string& header_str, HeaderMap& map) headerStr.c_str(), headerStr.length())); void* iter = NULL; std::string name, value; - while(headers->EnumerateHeaderLines(&iter, &name, &value)) + while (headers->EnumerateHeaderLines(&iter, &name, &value)) map.insert(std::make_pair(name, value)); } -} // namespace HttpHeaderUtils +} // namespace HttpHeaderUtils diff --git a/libcef/http_header_utils.h b/libcef/http_header_utils.h index 7a3179766..c762d1347 100644 --- a/libcef/http_header_utils.h +++ b/libcef/http_header_utils.h @@ -2,8 +2,11 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _HTTP_HEADER_UTILS_H -#define _HTTP_HEADER_UTILS_H +#ifndef CEF_LIBCEF_HTTP_HEADER_UTILS_H_ +#define CEF_LIBCEF_HTTP_HEADER_UTILS_H_ +#pragma once + +#include #include "include/cef_request.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPHeaderVisitor.h" @@ -13,24 +16,22 @@ namespace HttpHeaderUtils { typedef CefRequest::HeaderMap HeaderMap; -class HeaderVisitor : public WebKit::WebHTTPHeaderVisitor -{ -public: - HeaderVisitor(HeaderMap* map) : map_(map) {} +class HeaderVisitor : public WebKit::WebHTTPHeaderVisitor { + public: + explicit HeaderVisitor(HeaderMap* map) : map_(map) {} virtual void visitHeader(const WebKit::WebString& name, - const WebKit::WebString& value) - { + const WebKit::WebString& value) { map_->insert(std::make_pair(string16(name), string16(value))); } -private: + private: HeaderMap* map_; }; std::string GenerateHeaders(const HeaderMap& map); void ParseHeaders(const std::string& header_str, HeaderMap& map); -}; // namespace HttpHeaderUtils +}; // namespace HttpHeaderUtils -#endif // _HTTP_HEADER_UTILS_H +#endif // CEF_LIBCEF_HTTP_HEADER_UTILS_H_ diff --git a/libcef/nplugin_impl.cc b/libcef/nplugin_impl.cc index 9ab58a1d1..86bad53bf 100644 --- a/libcef/nplugin_impl.cc +++ b/libcef/nplugin_impl.cc @@ -3,8 +3,8 @@ // be found in the LICENSE file. #include "include/cef_nplugin.h" -#include "cef_context.h" -#include "cef_thread.h" +#include "libcef/cef_context.h" +#include "libcef/cef_thread.h" #include "base/string_split.h" #include "base/utf_string_conversions.h" @@ -12,8 +12,7 @@ namespace { -void UIT_RegisterPlugin(CefPluginInfo* plugin_info) -{ +void UIT_RegisterPlugin(CefPluginInfo* plugin_info) { REQUIRE_UIT(); webkit::WebPluginInfo info; @@ -33,13 +32,13 @@ void UIT_RegisterPlugin(CefPluginInfo* plugin_info) for (size_t i = 0; i < mime_types.size(); ++i) { webkit::WebPluginMimeType mimeType; - + mimeType.mime_type = mime_types[i]; - + if (file_extensions.size() > i) { base::SplitString(file_extensions[i], ',', &file_extensions_parts); VectorType::const_iterator it = file_extensions_parts.begin(); - for(; it != file_extensions_parts.end(); ++it) + for (; it != file_extensions_parts.end(); ++it) mimeType.file_extensions.push_back(*(it)); file_extensions_parts.clear(); } @@ -63,10 +62,9 @@ void UIT_RegisterPlugin(CefPluginInfo* plugin_info) delete plugin_info; } -} // anonymous +} // namespace -bool CefRegisterPlugin(const CefPluginInfo& plugin_info) -{ +bool CefRegisterPlugin(const CefPluginInfo& plugin_info) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -75,6 +73,6 @@ bool CefRegisterPlugin(const CefPluginInfo& plugin_info) CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableFunction(UIT_RegisterPlugin, new CefPluginInfo(plugin_info))); - + return true; } diff --git a/libcef/origin_whitelist_impl.cc b/libcef/origin_whitelist_impl.cc index 5c32d096b..c31a72d08 100644 --- a/libcef/origin_whitelist_impl.cc +++ b/libcef/origin_whitelist_impl.cc @@ -3,8 +3,8 @@ // can be found in the LICENSE file. #include "include/cef_origin_whitelist.h" -#include "cef_context.h" -#include "cef_thread.h" +#include "libcef/cef_context.h" +#include "libcef/cef_thread.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" @@ -16,8 +16,7 @@ using WebKit::WebString; bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, - bool allow_target_subdomains) -{ + bool allow_target_subdomains) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED(); @@ -52,8 +51,7 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, - bool allow_target_subdomains) -{ + bool allow_target_subdomains) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED(); @@ -85,8 +83,7 @@ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, return true; } -bool CefClearCrossOriginWhitelist() -{ +bool CefClearCrossOriginWhitelist() { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED(); diff --git a/libcef/printing/print_settings.cc b/libcef/printing/print_settings.cc index 4802eaaba..e306eac75 100644 --- a/libcef/printing/print_settings.cc +++ b/libcef/printing/print_settings.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "print_settings.h" +#include "libcef/printing/print_settings.h" #include "base/atomic_sequence_num.h" #include "base/logging.h" @@ -60,9 +60,11 @@ void PrintSettings::Clear() { void PrintSettings::ResetRequestedPageMargins() { // Initial requested margins to = 1.0cm = ~2/5 of inch - const int margin_printer_units = ConvertUnit(1000, kHundrethsMMPerInch, desired_dpi); + const int margin_printer_units = + ConvertUnit(1000, kHundrethsMMPerInch, desired_dpi); // Initial requested header/footer margins to = 0.5cm = ~1/5 of inch - const int header_footer_margins = ConvertUnit(500, kHundrethsMMPerInch, desired_dpi); + const int header_footer_margins = + ConvertUnit(500, kHundrethsMMPerInch, desired_dpi); requested_margins.header = header_footer_margins; requested_margins.footer = header_footer_margins; requested_margins.left = margin_printer_units; @@ -88,7 +90,7 @@ void PrintSettings::Init(HDC hdc, bool is_custom_paper = true; if (dev_mode.dmFields & DM_PAPERSIZE) { - switch(dev_mode.dmPaperSize) { + switch (dev_mode.dmPaperSize) { case DMPAPER_LETTER: page_measurements.page_type = PT_LETTER; is_custom_paper = false; @@ -110,7 +112,7 @@ void PrintSettings::Init(HDC hdc, is_custom_paper = false; break; default: - //we'll translate it as a custom paper size. + // We'll translate it as a custom paper size. break; } } @@ -147,7 +149,6 @@ void PrintSettings::Init(HDC hdc, page_measurements.page_length = page_measurements.page_width; page_measurements.page_width = temp; } - } SetPrinterPrintableArea(physical_size_pixels, printable_area_pixels); } @@ -156,7 +157,7 @@ void PrintSettings::Init(HDC hdc, void PrintSettings::SetPrinterPrintableArea( gfx::Size const& physical_size_pixels, gfx::Rect const& printable_area_pixels) { - + // Hard-code text_height = 0.5cm = ~1/5 of inch const int text_height = ConvertUnit(500, kHundrethsMMPerInch, dpi_); @@ -215,10 +216,9 @@ int PrintSettings::NewCookie() { } void PrintSettings::UpdatePrintOptions(cef_print_options_t& print_options) { - print_options.page_orientation = (landscape) ? LANDSCAPE : PORTRAIT; print_options.paper_metrics.paper_type = page_measurements.page_type; - + if (page_measurements.page_type == PT_CUSTOM) { print_options.paper_metrics.length = ConvertUnitDouble( page_measurements.page_length, desired_dpi, 1); diff --git a/libcef/printing/print_settings.h b/libcef/printing/print_settings.h index c9029b885..d1f2335ac 100644 --- a/libcef/printing/print_settings.h +++ b/libcef/printing/print_settings.h @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _PRINTING_PRINT_SETTINGS_H -#define _PRINTING_PRINT_SETTINGS_H +#ifndef CEF_LIBCEF_PRINTING_PRINT_SETTINGS_H_ +#define CEF_LIBCEF_PRINTING_PRINT_SETTINGS_H_ +#pragma once #include "include/internal/cef_types.h" @@ -56,7 +57,7 @@ struct PrintParams { // Page measurements information. class PageMeasurements { -public: + public: PageMeasurements(); void Clear(); @@ -154,6 +155,7 @@ class PrintSettings { // Page Measurements. PageMeasurements page_measurements; + private: void ResetRequestedPageMargins(); ////////////////////////////////////////////////////////////////////////////// @@ -174,5 +176,5 @@ class PrintSettings { } // namespace printing -#endif // _PRINTING_PRINT_SETTINGS_H +#endif // CEF_LIBCEF_PRINTING_PRINT_SETTINGS_H_ diff --git a/libcef/printing/win_printing_context.cc b/libcef/printing/win_printing_context.cc index 29c1d1213..aca730b26 100644 --- a/libcef/printing/win_printing_context.cc +++ b/libcef/printing/win_printing_context.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "win_printing_context.h" +#include "libcef/printing/win_printing_context.h" #include @@ -94,13 +94,14 @@ PrintingContext::Result PrintingContext::AskUserForSettings( // Adjust the default dev mode for the printdlg settings. DEVMODE dev_mode; - memset(&dev_mode,0,sizeof(dev_mode)); + memset(&dev_mode, 0, sizeof(dev_mode)); dev_mode.dmSpecVersion = DM_SPECVERSION; dev_mode.dmSize = sizeof(DEVMODE); AdjustDevMode(dev_mode); dialog_options.hDevMode = GlobalAlloc(GMEM_MOVEABLE, sizeof(DEVMODE)); - DEVMODE* locked_dev_mode = reinterpret_cast(GlobalLock(dialog_options.hDevMode)); + DEVMODE* locked_dev_mode = + reinterpret_cast(GlobalLock(dialog_options.hDevMode)); memcpy(locked_dev_mode, &dev_mode, sizeof(DEVMODE)); GlobalUnlock(dialog_options.hDevMode); { @@ -124,13 +125,13 @@ PrintingContext::Result PrintingContext::UseDefaultSettings() { return ParseDialogResult(dialog_options); } -void PrintingContext::AdjustDevMode(DEVMODE& dev_mode) -{ +void PrintingContext::AdjustDevMode(DEVMODE& dev_mode) { dev_mode.dmFields |= DM_ORIENTATION; - dev_mode.dmOrientation = (settings_.landscape) ? DMORIENT_LANDSCAPE : DMORIENT_PORTRAIT; + dev_mode.dmOrientation = + (settings_.landscape) ? DMORIENT_LANDSCAPE : DMORIENT_PORTRAIT; dev_mode.dmFields |= DM_PAPERSIZE; - switch(settings_.page_measurements.page_type) { + switch (settings_.page_measurements.page_type) { case PT_LETTER: dev_mode.dmPaperSize = DMPAPER_LETTER; break; @@ -153,18 +154,20 @@ void PrintingContext::AdjustDevMode(DEVMODE& dev_mode) DCHECK_GT(settings_.page_measurements.page_length, 0); DCHECK_GT(settings_.page_measurements.page_width, 0); // Convert from desired_dpi to tenths of a mm. - dev_mode.dmPaperLength = static_cast( - ConvertUnitDouble(abs(settings_.page_measurements.page_length), - 10.0 * settings_.desired_dpi, - static_cast(kHundrethsMMPerInch)) + 0.5); - dev_mode.dmPaperWidth = static_cast( - ConvertUnitDouble(abs(settings_.page_measurements.page_width), - 10.0 * settings_.desired_dpi, - static_cast(kHundrethsMMPerInch)) + 0.5); + dev_mode.dmPaperLength = + static_cast(ConvertUnitDouble( // NOLINT(runtime/int) + abs(settings_.page_measurements.page_length), + 10.0 * settings_.desired_dpi, + static_cast(kHundrethsMMPerInch)) + 0.5); + dev_mode.dmPaperWidth = + static_cast(ConvertUnitDouble( // NOLINT(runtime/int) + abs(settings_.page_measurements.page_width), + 10.0 * settings_.desired_dpi, + static_cast(kHundrethsMMPerInch)) + 0.5); break; } default: - //we shouldn't ever hit this case. + // We shouldn't ever hit this case. DCHECK(false); dev_mode.dmPaperSize = DMPAPER_LETTER; break; @@ -175,7 +178,7 @@ PrintingContext::Result PrintingContext::Init() { DCHECK(!in_print_job_); TCHAR printername[512]; DWORD size = sizeof(printername)-1; - if(GetDefaultPrinter(printername, &size)) { + if (GetDefaultPrinter(printername, &size)) { return Init(CefString(printername), false); } return FAILED; @@ -189,7 +192,7 @@ PrintingContext::Result PrintingContext::InitWithSettings( return Init(settings_.device_name(), true); } -PrintingContext::Result PrintingContext::Init(const CefString& device_name, +PrintingContext::Result PrintingContext::Init(const CefString& device_name, bool adjust_dev_mode) { HANDLE printer; std::wstring deviceNameStr = device_name; @@ -255,7 +258,7 @@ PrintingContext::Result PrintingContext::NewDocument( OFN_NOREADONLYRETURN | OFN_ENABLESIZING; ofn.lpstrDefExt = L"ps"; - if(GetSaveFileName(&ofn)) + if (GetSaveFileName(&ofn)) di.lpszOutput = szFileName; else return OnError(); @@ -466,7 +469,8 @@ PrintingContext::Result PrintingContext::ParseDialogResultEx( // If the user clicked OK or Apply then Cancel, but not only Cancel. if (dialog_options.dwResultAction != PD_RESULT_CANCEL) { PageMargins requested_margins = settings_.requested_margins; - // Start fresh except for page margins since that isn't controlled by this dialog. + // Start fresh except for page margins since that isn't controlled by this + // dialog. ResetSettings(); settings_.requested_margins = requested_margins; diff --git a/libcef/printing/win_printing_context.h b/libcef/printing/win_printing_context.h index 8e0bcbe58..1326d2f8e 100644 --- a/libcef/printing/win_printing_context.h +++ b/libcef/printing/win_printing_context.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _PRINTING_WIN_PRINTING_CONTEXT_H -#define _PRINTING_WIN_PRINTING_CONTEXT_H - -#include "print_settings.h" +#ifndef CEF_LIBCEF_PRINTING_WIN_PRINTING_CONTEXT_H_ +#define CEF_LIBCEF_PRINTING_WIN_PRINTING_CONTEXT_H_ +#pragma once #include #include #include +#include "libcef/printing/print_settings.h" #include "base/basictypes.h" namespace printing { @@ -109,7 +109,7 @@ class PrintingContext { // Allocates the HDC for a specific DEVMODE. bool AllocateContext(const CefString& printer_name, const DEVMODE* dev_mode); - + // Updates printer dev_mode with settings_ void PrintingContext::AdjustDevMode(DEVMODE& dev_mode); @@ -148,4 +148,4 @@ class PrintingContext { } // namespace printing -#endif // _PRINTING_WIN_PRINTING_CONTEXT_H +#endif // CEF_LIBCEF_PRINTING_WIN_PRINTING_CONTEXT_H_ diff --git a/libcef/request_impl.cc b/libcef/request_impl.cc index 8abf6821b..6c9e0cca7 100644 --- a/libcef/request_impl.cc +++ b/libcef/request_impl.cc @@ -2,72 +2,63 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "request_impl.h" +#include "libcef/request_impl.h" +#include "libcef/http_header_utils.h" #include "base/logging.h" #include "net/url_request/url_request.h" -#include "http_header_utils.h" using WebKit::WebHTTPBody; using WebKit::WebString; using WebKit::WebURL; using WebKit::WebURLRequest; -CefRefPtr CefRequest::CreateRequest() -{ +CefRefPtr CefRequest::CreateRequest() { CefRefPtr request(new CefRequestImpl()); return request; } CefRequestImpl::CefRequestImpl() - : method_("GET"), flags_(WUR_FLAG_NONE) -{ + : method_("GET"), + flags_(WUR_FLAG_NONE) { } -CefString CefRequestImpl::GetURL() -{ +CefString CefRequestImpl::GetURL() { AutoLock lock_scope(this); return url_; } -void CefRequestImpl::SetURL(const CefString& url) -{ +void CefRequestImpl::SetURL(const CefString& url) { AutoLock lock_scope(this); url_ = url; } -CefString CefRequestImpl::GetMethod() -{ +CefString CefRequestImpl::GetMethod() { AutoLock lock_scope(this); return method_; } -void CefRequestImpl::SetMethod(const CefString& method) -{ +void CefRequestImpl::SetMethod(const CefString& method) { AutoLock lock_scope(this); method_ = method; } -CefRefPtr CefRequestImpl::GetPostData() -{ +CefRefPtr CefRequestImpl::GetPostData() { AutoLock lock_scope(this); return postdata_; } -void CefRequestImpl::SetPostData(CefRefPtr postData) -{ +void CefRequestImpl::SetPostData(CefRefPtr postData) { AutoLock lock_scope(this); postdata_ = postData; } -void CefRequestImpl::GetHeaderMap(HeaderMap& headerMap) -{ +void CefRequestImpl::GetHeaderMap(HeaderMap& headerMap) { AutoLock lock_scope(this); headerMap = headermap_; } -void CefRequestImpl::SetHeaderMap(const HeaderMap& headerMap) -{ +void CefRequestImpl::SetHeaderMap(const HeaderMap& headerMap) { AutoLock lock_scope(this); headermap_ = headerMap; } @@ -75,8 +66,7 @@ void CefRequestImpl::SetHeaderMap(const HeaderMap& headerMap) void CefRequestImpl::Set(const CefString& url, const CefString& method, CefRefPtr postData, - const HeaderMap& headerMap) -{ + const HeaderMap& headerMap) { AutoLock lock_scope(this); url_ = url; method_ = method; @@ -84,8 +74,7 @@ void CefRequestImpl::Set(const CefString& url, headermap_ = headerMap; } -void CefRequestImpl::Set(net::URLRequest* request) -{ +void CefRequestImpl::Set(net::URLRequest* request) { AutoLock lock_scope(this); url_ = request->url().spec(); @@ -94,7 +83,7 @@ void CefRequestImpl::Set(net::URLRequest* request) // Transfer request headers GetHeaderMap(request->extra_request_headers(), headermap_); headermap_.insert(std::make_pair(L"Referrer", request->referrer())); - + // Transfer post data, if any net::UploadData* data = request->get_upload(); if (data) { @@ -103,8 +92,7 @@ void CefRequestImpl::Set(net::URLRequest* request) } } -void CefRequestImpl::Set(const WebKit::WebURLRequest& request) -{ +void CefRequestImpl::Set(const WebKit::WebURLRequest& request) { DCHECK(!request.isNull()); AutoLock lock_scope(this); @@ -115,7 +103,7 @@ void CefRequestImpl::Set(const WebKit::WebURLRequest& request) if (!body.isNull()) { postdata_ = new CefPostDataImpl(); static_cast(postdata_.get())->Set(body); - } else if(postdata_.get()) { + } else if (postdata_.get()) { postdata_ = NULL; } @@ -143,8 +131,7 @@ void CefRequestImpl::Set(const WebKit::WebURLRequest& request) #define SETBOOLFLAG(obj, flags, method, FLAG) \ obj.method((flags & (FLAG)) == (FLAG)) -void CefRequestImpl::Get(WebKit::WebURLRequest& request) -{ +void CefRequestImpl::Get(WebKit::WebURLRequest& request) { request.initialize(); AutoLock lock_scope(this); @@ -169,13 +156,13 @@ void CefRequestImpl::Get(WebKit::WebURLRequest& request) WebURLRequest::ReloadIgnoringCacheData : WebURLRequest::UseProtocolCachePolicy); - SETBOOLFLAG(request, flags_, setAllowStoredCredentials, + SETBOOLFLAG(request, flags_, setAllowStoredCredentials, WUR_FLAG_ALLOW_CACHED_CREDENTIALS); - SETBOOLFLAG(request, flags_, setAllowCookies, + SETBOOLFLAG(request, flags_, setAllowCookies, WUR_FLAG_ALLOW_COOKIES); - SETBOOLFLAG(request, flags_, setReportUploadProgress, + SETBOOLFLAG(request, flags_, setReportUploadProgress, WUR_FLAG_REPORT_UPLOAD_PROGRESS); - SETBOOLFLAG(request, flags_, setReportLoadTiming, + SETBOOLFLAG(request, flags_, setReportLoadTiming, WUR_FLAG_REPORT_LOAD_TIMING); SETBOOLFLAG(request, flags_, setReportRawHeaders, WUR_FLAG_REPORT_RAW_HEADERS); @@ -187,32 +174,27 @@ void CefRequestImpl::Get(WebKit::WebURLRequest& request) } } -CefRequest::RequestFlags CefRequestImpl::GetFlags() -{ +CefRequest::RequestFlags CefRequestImpl::GetFlags() { AutoLock lock_scope(this); return flags_; } -void CefRequestImpl::SetFlags(RequestFlags flags) -{ +void CefRequestImpl::SetFlags(RequestFlags flags) { AutoLock lock_scope(this); flags_ = flags; } -CefString CefRequestImpl::GetFirstPartyForCookies() -{ +CefString CefRequestImpl::GetFirstPartyForCookies() { AutoLock lock_scope(this); return first_party_for_cookies_; } -void CefRequestImpl::SetFirstPartyForCookies(const CefString& url) -{ +void CefRequestImpl::SetFirstPartyForCookies(const CefString& url) { AutoLock lock_scope(this); first_party_for_cookies_ = url; } // static -void CefRequestImpl::GetHeaderMap(const net::HttpRequestHeaders& headers, - HeaderMap& map) -{ +void CefRequestImpl::GetHeaderMap(const net::HttpRequestHeaders& headers, + HeaderMap& map) { net::HttpRequestHeaders::Iterator it(headers); do { map.insert(std::make_pair(it.name(), it.value())); @@ -221,50 +203,43 @@ void CefRequestImpl::GetHeaderMap(const net::HttpRequestHeaders& headers, // static void CefRequestImpl::GetHeaderMap(const WebKit::WebURLRequest& request, - HeaderMap& map) -{ + HeaderMap& map) { HttpHeaderUtils::HeaderVisitor visitor(&map); request.visitHTTPHeaderFields(&visitor); } // static void CefRequestImpl::SetHeaderMap(const HeaderMap& map, - WebKit::WebURLRequest& request) -{ + WebKit::WebURLRequest& request) { HeaderMap::const_iterator it = map.begin(); - for(; it != map.end(); ++it) + for (; it != map.end(); ++it) request.setHTTPHeaderField(string16(it->first), string16(it->second)); } -CefRefPtr CefPostData::CreatePostData() -{ +CefRefPtr CefPostData::CreatePostData() { CefRefPtr postdata(new CefPostDataImpl()); return postdata; } -CefPostDataImpl::CefPostDataImpl() -{ +CefPostDataImpl::CefPostDataImpl() { } -size_t CefPostDataImpl::GetElementCount() -{ +size_t CefPostDataImpl::GetElementCount() { AutoLock lock_scope(this); return elements_.size(); } -void CefPostDataImpl::GetElements(ElementVector& elements) -{ +void CefPostDataImpl::GetElements(ElementVector& elements) { AutoLock lock_scope(this); elements = elements_; } -bool CefPostDataImpl::RemoveElement(CefRefPtr element) -{ +bool CefPostDataImpl::RemoveElement(CefRefPtr element) { AutoLock lock_scope(this); ElementVector::iterator it = elements_.begin(); - for(; it != elements_.end(); ++it) { - if(it->get() == element.get()) { + for (; it != elements_.end(); ++it) { + if (it->get() == element.get()) { elements_.erase(it); return true; } @@ -273,35 +248,32 @@ bool CefPostDataImpl::RemoveElement(CefRefPtr element) return false; } -bool CefPostDataImpl::AddElement(CefRefPtr element) -{ +bool CefPostDataImpl::AddElement(CefRefPtr element) { bool found = false; - + AutoLock lock_scope(this); - + // check that the element isn't already in the list before adding ElementVector::const_iterator it = elements_.begin(); - for(; it != elements_.end(); ++it) { - if(it->get() == element.get()) { + for (; it != elements_.end(); ++it) { + if (it->get() == element.get()) { found = true; break; } } - if(!found) + if (!found) elements_.push_back(element); - + return !found; } -void CefPostDataImpl::RemoveElements() -{ +void CefPostDataImpl::RemoveElements() { AutoLock lock_scope(this); elements_.clear(); } -void CefPostDataImpl::Set(net::UploadData& data) -{ +void CefPostDataImpl::Set(net::UploadData& data) { AutoLock lock_scope(this); CefRefPtr postelem; @@ -315,22 +287,20 @@ void CefPostDataImpl::Set(net::UploadData& data) } } -void CefPostDataImpl::Get(net::UploadData& data) -{ +void CefPostDataImpl::Get(net::UploadData& data) { AutoLock lock_scope(this); net::UploadData::Element element; std::vector data_elements; ElementVector::iterator it = elements_.begin(); - for(; it != elements_.end(); ++it) { + for (; it != elements_.end(); ++it) { static_cast(it->get())->Get(element); data_elements.push_back(element); } data.SetElements(data_elements); } -void CefPostDataImpl::Set(const WebKit::WebHTTPBody& data) -{ +void CefPostDataImpl::Set(const WebKit::WebHTTPBody& data) { AutoLock lock_scope(this); CefRefPtr postelem; @@ -345,17 +315,16 @@ void CefPostDataImpl::Set(const WebKit::WebHTTPBody& data) } } -void CefPostDataImpl::Get(WebKit::WebHTTPBody& data) -{ +void CefPostDataImpl::Get(WebKit::WebHTTPBody& data) { AutoLock lock_scope(this); WebKit::WebHTTPBody::Element element; ElementVector::iterator it = elements_.begin(); - for(; it != elements_.end(); ++it) { + for (; it != elements_.end(); ++it) { static_cast(it->get())->Get(element); - if(element.type == WebKit::WebHTTPBody::Element::TypeData) { + if (element.type == WebKit::WebHTTPBody::Element::TypeData) { data.appendData(element.data); - } else if(element.type == WebKit::WebHTTPBody::Element::TypeFile) { + } else if (element.type == WebKit::WebHTTPBody::Element::TypeFile) { data.appendFile(element.filePath); } else { NOTREACHED(); @@ -363,36 +332,31 @@ void CefPostDataImpl::Get(WebKit::WebHTTPBody& data) } } -CefRefPtr CefPostDataElement::CreatePostDataElement() -{ +CefRefPtr CefPostDataElement::CreatePostDataElement() { CefRefPtr element(new CefPostDataElementImpl()); return element; } -CefPostDataElementImpl::CefPostDataElementImpl() -{ +CefPostDataElementImpl::CefPostDataElementImpl() { type_ = PDE_TYPE_EMPTY; memset(&data_, 0, sizeof(data_)); } -CefPostDataElementImpl::~CefPostDataElementImpl() -{ +CefPostDataElementImpl::~CefPostDataElementImpl() { SetToEmpty(); } -void CefPostDataElementImpl::SetToEmpty() -{ +void CefPostDataElementImpl::SetToEmpty() { AutoLock lock_scope(this); - if(type_ == PDE_TYPE_BYTES) + if (type_ == PDE_TYPE_BYTES) free(data_.bytes.bytes); - else if(type_ == PDE_TYPE_FILE) + else if (type_ == PDE_TYPE_FILE) cef_string_clear(&data_.filename); type_ = PDE_TYPE_EMPTY; memset(&data_, 0, sizeof(data_)); } -void CefPostDataElementImpl::SetToFile(const CefString& fileName) -{ +void CefPostDataElementImpl::SetToFile(const CefString& fileName) { AutoLock lock_scope(this); // Clear any data currently in the element SetToEmpty(); @@ -402,8 +366,7 @@ void CefPostDataElementImpl::SetToFile(const CefString& fileName) cef_string_copy(fileName.c_str(), fileName.length(), &data_.filename); } -void CefPostDataElementImpl::SetToBytes(size_t size, const void* bytes) -{ +void CefPostDataElementImpl::SetToBytes(size_t size, const void* bytes) { AutoLock lock_scope(this); // Clear any data currently in the element SetToEmpty(); @@ -411,56 +374,51 @@ void CefPostDataElementImpl::SetToBytes(size_t size, const void* bytes) // Assign the new data void* data = malloc(size); DCHECK(data != NULL); - if(data == NULL) + if (data == NULL) return; memcpy(data, bytes, size); - + type_ = PDE_TYPE_BYTES; data_.bytes.bytes = data; data_.bytes.size = size; } -CefPostDataElement::Type CefPostDataElementImpl::GetType() -{ +CefPostDataElement::Type CefPostDataElementImpl::GetType() { AutoLock lock_scope(this); return type_; } -CefString CefPostDataElementImpl::GetFile() -{ +CefString CefPostDataElementImpl::GetFile() { AutoLock lock_scope(this); DCHECK(type_ == PDE_TYPE_FILE); CefString filename; - if(type_ == PDE_TYPE_FILE) + if (type_ == PDE_TYPE_FILE) filename.FromString(data_.filename.str, data_.filename.length, false); return filename; } -size_t CefPostDataElementImpl::GetBytesCount() -{ +size_t CefPostDataElementImpl::GetBytesCount() { AutoLock lock_scope(this); DCHECK(type_ == PDE_TYPE_BYTES); size_t size = 0; - if(type_ == PDE_TYPE_BYTES) + if (type_ == PDE_TYPE_BYTES) size = data_.bytes.size; return size; } -size_t CefPostDataElementImpl::GetBytes(size_t size, void* bytes) -{ +size_t CefPostDataElementImpl::GetBytes(size_t size, void* bytes) { AutoLock lock_scope(this); DCHECK(type_ == PDE_TYPE_BYTES); size_t rv = 0; - if(type_ == PDE_TYPE_BYTES) { + if (type_ == PDE_TYPE_BYTES) { rv = (size < data_.bytes.size ? size : data_.bytes.size); memcpy(bytes, data_.bytes.bytes, rv); } return rv; } -void CefPostDataElementImpl::Set(const net::UploadData::Element& element) -{ +void CefPostDataElementImpl::Set(const net::UploadData::Element& element) { AutoLock lock_scope(this); if (element.type() == net::UploadData::TYPE_BYTES) { @@ -475,13 +433,12 @@ void CefPostDataElementImpl::Set(const net::UploadData::Element& element) } } -void CefPostDataElementImpl::Get(net::UploadData::Element& element) -{ +void CefPostDataElementImpl::Get(net::UploadData::Element& element) { AutoLock lock_scope(this); - if(type_ == PDE_TYPE_BYTES) { + if (type_ == PDE_TYPE_BYTES) { element.SetToBytes(static_cast(data_.bytes.bytes), data_.bytes.size); - } else if(type_ == PDE_TYPE_FILE) { + } else if (type_ == PDE_TYPE_FILE) { FilePath path = FilePath(CefString(&data_.filename)); element.SetToFilePath(path); } else { @@ -489,29 +446,27 @@ void CefPostDataElementImpl::Get(net::UploadData::Element& element) } } -void CefPostDataElementImpl::Set(const WebKit::WebHTTPBody::Element& element) -{ +void CefPostDataElementImpl::Set(const WebKit::WebHTTPBody::Element& element) { AutoLock lock_scope(this); - if(element.type == WebKit::WebHTTPBody::Element::TypeData) { + if (element.type == WebKit::WebHTTPBody::Element::TypeData) { SetToBytes(element.data.size(), static_cast(element.data.data())); - } else if(element.type == WebKit::WebHTTPBody::Element::TypeFile) { + } else if (element.type == WebKit::WebHTTPBody::Element::TypeFile) { SetToFile(string16(element.filePath)); } else { NOTREACHED(); } } -void CefPostDataElementImpl::Get(WebKit::WebHTTPBody::Element& element) -{ +void CefPostDataElementImpl::Get(WebKit::WebHTTPBody::Element& element) { AutoLock lock_scope(this); - if(type_ == PDE_TYPE_BYTES) { + if (type_ == PDE_TYPE_BYTES) { element.type = WebKit::WebHTTPBody::Element::TypeData; element.data.assign( static_cast(data_.bytes.bytes), data_.bytes.size); - } else if(type_ == PDE_TYPE_FILE) { + } else if (type_ == PDE_TYPE_FILE) { element.type = WebKit::WebHTTPBody::Element::TypeFile; element.filePath.assign(string16(CefString(&data_.filename))); } else { diff --git a/libcef/request_impl.h b/libcef/request_impl.h index 36ddeedec..a4b9a0799 100644 --- a/libcef/request_impl.h +++ b/libcef/request_impl.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _REQUEST_IMPL_H -#define _REQUEST_IMPL_H +#ifndef CEF_LIBCEF_REQUEST_IMPL_H_ +#define CEF_LIBCEF_REQUEST_IMPL_H_ +#pragma once #include "include/cef_request.h" #include "net/base/upload_data.h" @@ -16,9 +17,8 @@ class URLRequest; }; // Implementation of CefRequest -class CefRequestImpl : public CefRequest -{ -public: +class CefRequestImpl : public CefRequest { + public: CefRequestImpl(); ~CefRequestImpl() {} @@ -50,7 +50,7 @@ public: static void SetHeaderMap(const HeaderMap& map, WebKit::WebURLRequest& request); -protected: + protected: CefString url_; CefString method_; CefRefPtr postdata_; @@ -65,9 +65,8 @@ protected: }; // Implementation of CefPostData -class CefPostDataImpl : public CefPostData -{ -public: +class CefPostDataImpl : public CefPostData { + public: CefPostDataImpl(); ~CefPostDataImpl() {} @@ -82,7 +81,7 @@ public: void Set(const WebKit::WebHTTPBody& data); void Get(WebKit::WebHTTPBody& data); -protected: + protected: ElementVector elements_; IMPLEMENT_REFCOUNTING(CefPostDataImpl); @@ -90,9 +89,8 @@ protected: }; // Implementation of CefPostDataElement -class CefPostDataElementImpl : public CefPostDataElement -{ -public: +class CefPostDataElementImpl : public CefPostDataElement { + public: CefPostDataElementImpl(); ~CefPostDataElementImpl(); @@ -111,7 +109,7 @@ public: void Set(const WebKit::WebHTTPBody::Element& element); void Get(WebKit::WebHTTPBody::Element& element); -protected: + protected: Type type_; union { struct { @@ -125,4 +123,4 @@ protected: IMPLEMENT_LOCKING(CefPostDataElementImpl); }; -#endif // _REQUEST_IMPL_H +#endif // CEF_LIBCEF_REQUEST_IMPL_H_ diff --git a/libcef/response_impl.cc b/libcef/response_impl.cc index 300062e03..0dc9c6807 100644 --- a/libcef/response_impl.cc +++ b/libcef/response_impl.cc @@ -2,8 +2,8 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "response_impl.h" -#include "http_header_utils.h" +#include "libcef/response_impl.h" +#include "libcef/http_header_utils.h" #include "base/logging.h" #include "base/stringprintf.h" @@ -12,12 +12,10 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLResponse.h" CefResponseImpl::CefResponseImpl() - : status_code_(0) -{ + : status_code_(0) { } -CefResponseImpl::CefResponseImpl(const WebKit::WebURLResponse &response) -{ +CefResponseImpl::CefResponseImpl(const WebKit::WebURLResponse &response) { DCHECK(!response.isNull()); WebKit::WebString str; @@ -31,44 +29,37 @@ CefResponseImpl::CefResponseImpl(const WebKit::WebURLResponse &response) response.visitHTTPHeaderFields(&visitor); } -int CefResponseImpl::GetStatus() -{ +int CefResponseImpl::GetStatus() { AutoLock lock_scope(this); return status_code_; } -void CefResponseImpl::SetStatus(int status) -{ +void CefResponseImpl::SetStatus(int status) { AutoLock lock_scope(this); status_code_ = status; } -CefString CefResponseImpl::GetStatusText() -{ +CefString CefResponseImpl::GetStatusText() { AutoLock lock_scope(this); return status_text_; } -void CefResponseImpl::SetStatusText(const CefString& statusText) -{ +void CefResponseImpl::SetStatusText(const CefString& statusText) { AutoLock lock_scope(this); status_text_ = statusText; } -CefString CefResponseImpl::GetMimeType() -{ +CefString CefResponseImpl::GetMimeType() { AutoLock lock_scope(this); return mime_type_; } -void CefResponseImpl::SetMimeType(const CefString& mimeType) -{ +void CefResponseImpl::SetMimeType(const CefString& mimeType) { AutoLock lock_scope(this); mime_type_ = mimeType; } -CefString CefResponseImpl::GetHeader(const CefString& name) -{ +CefString CefResponseImpl::GetHeader(const CefString& name) { AutoLock lock_scope(this); CefString value; @@ -80,26 +71,23 @@ CefString CefResponseImpl::GetHeader(const CefString& name) return value; } -void CefResponseImpl::GetHeaderMap(HeaderMap& map) -{ +void CefResponseImpl::GetHeaderMap(HeaderMap& map) { AutoLock lock_scope(this); map = header_map_; } -void CefResponseImpl::SetHeaderMap(const HeaderMap& headerMap) -{ +void CefResponseImpl::SetHeaderMap(const HeaderMap& headerMap) { AutoLock lock_scope(this); header_map_ = headerMap; } -net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() -{ +net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() { AutoLock lock_scope(this); std::string response; std::string status_text; - if(status_text_.empty()) + if (status_text_.empty()) status_text = (status_code_ == 200)?"OK":"ERROR"; else status_text = status_text_; @@ -107,13 +95,13 @@ net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() base::SStringPrintf(&response, "HTTP/1.1 %d %s", status_code_, status_text.c_str()); if (header_map_.size() > 0) { - for(HeaderMap::const_iterator header = header_map_.begin(); + for (HeaderMap::const_iterator header = header_map_.begin(); header != header_map_.end(); ++header) { const CefString& key = header->first; const CefString& value = header->second; - if(!key.empty()) { + if (!key.empty()) { // Delimit with "\0" as required by net::HttpResponseHeaders. std::string key_str(key); std::string value_str(value); diff --git a/libcef/response_impl.h b/libcef/response_impl.h index bd16e91b2..e4c7a49de 100644 --- a/libcef/response_impl.h +++ b/libcef/response_impl.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _RESPONSE_IMPL_H -#define _RESPONSE_IMPL_H +#ifndef CEF_LIBCEF_RESPONSE_IMPL_H_ +#define CEF_LIBCEF_RESPONSE_IMPL_H_ +#pragma once #include "include/cef_response.h" @@ -15,11 +16,10 @@ class WebURLResponse; }; // Implementation of CefResponse. -class CefResponseImpl : public CefResponse -{ -public: +class CefResponseImpl : public CefResponse { + public: CefResponseImpl(); - CefResponseImpl(const WebKit::WebURLResponse& response); + explicit CefResponseImpl(const WebKit::WebURLResponse& response); ~CefResponseImpl() {} // CefResponse API @@ -35,7 +35,7 @@ public: net::HttpResponseHeaders* GetResponseHeaders(); -protected: + protected: int status_code_; CefString status_text_; CefString mime_type_; @@ -45,4 +45,4 @@ protected: IMPLEMENT_LOCKING(CefResponseImpl); }; -#endif // _RESPONSE_IMPL_H +#endif // CEF_LIBCEF_RESPONSE_IMPL_H_ diff --git a/libcef/scheme_impl.cc b/libcef/scheme_impl.cc index 019cefd87..b22c3df92 100644 --- a/libcef/scheme_impl.cc +++ b/libcef/scheme_impl.cc @@ -3,14 +3,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + #include "include/cef_browser.h" #include "include/cef_scheme.h" -#include "browser_devtools_scheme_handler.h" -#include "browser_resource_loader_bridge.h" -#include "cef_context.h" -#include "cef_thread.h" -#include "request_impl.h" -#include "response_impl.h" +#include "libcef/browser_devtools_scheme_handler.h" +#include "libcef/browser_resource_loader_bridge.h" +#include "libcef/cef_context.h" +#include "libcef/cef_thread.h" +#include "libcef/request_impl.h" +#include "libcef/response_impl.h" #include "base/lazy_instance.h" #include "base/logging.h" @@ -36,22 +38,18 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" -#include - using net::URLRequestStatus; using WebKit::WebSecurityPolicy; using WebKit::WebString; namespace { -bool IsStandardScheme(const std::string& scheme) -{ +bool IsStandardScheme(const std::string& scheme) { url_parse::Component scheme_comp(0, scheme.length()); return url_util::IsStandard(scheme.c_str(), scheme_comp); } -void RegisterStandardScheme(const std::string& scheme) -{ +void RegisterStandardScheme(const std::string& scheme) { REQUIRE_UIT(); url_parse::Component scheme_comp(0, scheme.length()); if (!url_util::IsStandard(scheme.c_str(), scheme_comp)) @@ -72,8 +70,7 @@ static const SchemeToFactory kBuiltinFactories[] = { { "data", net::URLRequestDataJob::Factory }, }; -bool IsBuiltinScheme(const std::string& scheme) -{ +bool IsBuiltinScheme(const std::string& scheme) { for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) if (LowerCaseEqualsASCII(scheme, kBuiltinFactories[i].scheme)) return true; @@ -81,8 +78,7 @@ bool IsBuiltinScheme(const std::string& scheme) } net::URLRequestJob* GetBuiltinSchemeRequestJob(net::URLRequest* request, - const std::string& scheme) -{ + const std::string& scheme) { // See if the request should be handled by a built-in protocol factory. for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) { if (scheme == kBuiltinFactories[i].scheme) { @@ -95,8 +91,7 @@ net::URLRequestJob* GetBuiltinSchemeRequestJob(net::URLRequest* request, return NULL; } -std::string ToLower(const std::string& str) -{ +std::string ToLower(const std::string& str) { std::string str_lower = str; std::transform(str_lower.begin(), str_lower.end(), str_lower.begin(), towlower); @@ -106,43 +101,39 @@ std::string ToLower(const std::string& str) // net::URLRequestJob implementation. class CefUrlRequestJob : public net::URLRequestJob { -public: + public: CefUrlRequestJob(net::URLRequest* request, CefRefPtr handler) : net::URLRequestJob(request), handler_(handler), - remaining_bytes_(0) - { + remaining_bytes_(0) { } - virtual ~CefUrlRequestJob() - { + virtual ~CefUrlRequestJob() { } - virtual void Start() OVERRIDE - { + virtual void Start() OVERRIDE { REQUIRE_IOT(); if (!callback_) callback_ = new Callback(this); CefRefPtr req(CefRequest::CreateRequest()); - + // Populate the request data. static_cast(req.get())->Set(request()); - + // Handler can decide whether to process the request. bool rv = handler_->ProcessRequest(req, callback_.get()); if (!rv) { // Cancel the request. NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, ERR_ABORTED)); } - + return; } - virtual void Kill() OVERRIDE - { + virtual void Kill() OVERRIDE { REQUIRE_IOT(); // Notify the handler that the request has been canceled. @@ -157,8 +148,7 @@ public: } virtual bool ReadRawData(net::IOBuffer* dest, int dest_size, int *bytes_read) - OVERRIDE - { + OVERRIDE { REQUIRE_IOT(); DCHECK_NE(dest_size, 0); @@ -180,27 +170,26 @@ public: // The handler has indicated completion of the request. *bytes_read = 0; return true; - } else if(*bytes_read == 0) { + } else if (*bytes_read == 0) { if (!GetStatus().is_io_pending()) { // Report our status as IO pending. SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); callback_->SetDestination(dest, dest_size); } return false; - } else if(*bytes_read > dest_size) { + } else if (*bytes_read > dest_size) { // Normalize the return value. *bytes_read = dest_size; } - if(remaining_bytes_ > 0) + if (remaining_bytes_ > 0) remaining_bytes_ -= *bytes_read; // Continue calling this method. return true; } - virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE - { + virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE { REQUIRE_IOT(); if (response_.get()) { @@ -211,8 +200,7 @@ public: } virtual bool IsRedirectResponse(GURL* location, int* http_status_code) - OVERRIDE - { + OVERRIDE { REQUIRE_IOT(); if (redirect_url_.is_valid()) { @@ -229,7 +217,7 @@ public: CefResponse::HeaderMap headerMap; response_->GetHeaderMap(headerMap); CefRequest::HeaderMap::iterator iter = headerMap.find("Location"); - if(iter != headerMap.end()) { + if (iter != headerMap.end()) { GURL new_url = GURL(std::string(iter->second)); *http_status_code = status; location->Swap(&new_url); @@ -241,8 +229,7 @@ public: return false; } - virtual bool GetMimeType(std::string* mime_type) const OVERRIDE - { + virtual bool GetMimeType(std::string* mime_type) const OVERRIDE { REQUIRE_IOT(); if (response_.get()) @@ -253,9 +240,8 @@ public: CefRefPtr handler_; CefRefPtr response_; -private: - void SendHeaders() - { + private: + void SendHeaders() { REQUIRE_IOT(); // We may have been orphaned... @@ -282,16 +268,14 @@ private: } // Client callback for asynchronous response continuation. - class Callback : public CefSchemeHandlerCallback - { - public: - Callback(CefUrlRequestJob* job) + class Callback : public CefSchemeHandlerCallback { + public: + explicit Callback(CefUrlRequestJob* job) : job_(job), dest_(NULL), dest_size_() {} - virtual void HeadersAvailable() OVERRIDE - { + virtual void HeadersAvailable() OVERRIDE { if (CefThread::CurrentlyOn(CefThread::IO)) { // Currently on IO thread. if (job_ && !job_->has_response_started()) { @@ -305,8 +289,7 @@ private: } } - virtual void BytesAvailable() OVERRIDE - { + virtual void BytesAvailable() OVERRIDE { if (CefThread::CurrentlyOn(CefThread::IO)) { // Currently on IO thread. if (job_ && job_->has_response_started() && @@ -336,8 +319,7 @@ private: } } - virtual void Cancel() OVERRIDE - { + virtual void Cancel() OVERRIDE { if (CefThread::CurrentlyOn(CefThread::IO)) { // Currently on IO thread. if (job_) @@ -349,21 +331,19 @@ private: } } - void Detach() - { + void Detach() { REQUIRE_IOT(); job_ = NULL; } - void SetDestination(net::IOBuffer* dest, int dest_size) - { + void SetDestination(net::IOBuffer* dest, int dest_size) { dest_ = dest; dest_size_ = dest_size; } static bool ImplementsThreadSafeReferenceCounting() { return true; } - private: + private: CefUrlRequestJob* job_; net::IOBuffer* dest_; @@ -382,28 +362,27 @@ private: // Class that manages the CefSchemeHandlerFactory instances. class CefUrlRequestManager { -protected: + protected: // Class used for creating URLRequestJob instances. The lifespan of this // object is managed by URLRequestJobFactory. class ProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { - public: - ProtocolHandler(const std::string& scheme) + public: + explicit ProtocolHandler(const std::string& scheme) : scheme_(scheme) {} // From net::URLRequestJobFactory::ProtocolHandler virtual net::URLRequestJob* MaybeCreateJob( - net::URLRequest* request) const OVERRIDE - { + net::URLRequest* request) const OVERRIDE { REQUIRE_IOT(); return CefUrlRequestManager::GetInstance()->GetRequestJob(request, scheme_); } - private: + private: std::string scheme_; }; -public: + public: CefUrlRequestManager() {} // Retrieve the singleton instance. @@ -411,8 +390,7 @@ public: bool AddFactory(const std::string& scheme, const std::string& domain, - CefRefPtr factory) - { + CefRefPtr factory) { if (!factory.get()) { RemoveFactory(scheme, domain); return true; @@ -440,8 +418,7 @@ public: } void RemoveFactory(const std::string& scheme, - const std::string& domain) - { + const std::string& domain) { REQUIRE_IOT(); std::string scheme_lower = ToLower(scheme); @@ -458,8 +435,7 @@ public: } // Clear all the existing URL handlers and unregister the ProtocolFactory. - void ClearFactories() - { + void ClearFactories() { REQUIRE_IOT(); net::URLRequestJobFactory* job_factory = @@ -481,8 +457,7 @@ public: } // Check if a scheme has already been registered. - bool HasRegisteredScheme(const std::string& scheme) - { + bool HasRegisteredScheme(const std::string& scheme) { std::string scheme_lower = ToLower(scheme); // Don't register builtin schemes. @@ -499,8 +474,7 @@ public: bool RegisterScheme(const std::string& scheme, bool is_standard, bool is_local, - bool is_display_isolated) - { + bool is_display_isolated) { if (HasRegisteredScheme(scheme)) { NOTREACHED() << "Scheme already registered: " << scheme; return false; @@ -526,12 +500,11 @@ public: return true; } -private: + private: // Retrieve the matching handler factory, if any. |scheme| will already be in // lower case. CefRefPtr GetHandlerFactory( - net::URLRequest* request, const std::string& scheme) - { + net::URLRequest* request, const std::string& scheme) { CefRefPtr factory; if (request->url().is_valid() && IsStandardScheme(scheme)) { @@ -557,8 +530,7 @@ private: // Create the job that will handle the request. |scheme| will already be in // lower case. net::URLRequestJob* GetRequestJob(net::URLRequest* request, - const std::string& scheme) - { + const std::string& scheme) { net::URLRequestJob* job = NULL; CefRefPtr factory = GetHandlerFactory(request, scheme); @@ -583,7 +555,7 @@ private: if (job) DLOG(INFO) << "CefUrlRequestManager hit for " << request->url().spec(); #endif - + return job; } @@ -603,19 +575,17 @@ private: base::LazyInstance g_manager = LAZY_INSTANCE_INITIALIZER; -CefUrlRequestManager* CefUrlRequestManager::GetInstance() -{ +CefUrlRequestManager* CefUrlRequestManager::GetInstance() { return g_manager.Pointer(); } -} // anonymous +} // namespace bool CefRegisterCustomScheme(const CefString& scheme_name, bool is_standard, bool is_local, - bool is_display_isolated) -{ + bool is_display_isolated) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -632,7 +602,7 @@ bool CefRegisterCustomScheme(const CefString& scheme_name, NOTREACHED() << "Scheme already registered: " << scheme_name; return false; } - + CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableFunction(&CefRegisterCustomScheme, scheme_name, is_standard, is_local, is_display_isolated)); @@ -640,10 +610,10 @@ bool CefRegisterCustomScheme(const CefString& scheme_name, } } -bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, - const CefString& domain_name, - CefRefPtr factory) -{ +bool CefRegisterSchemeHandlerFactory( + const CefString& scheme_name, + const CefString& domain_name, + CefRefPtr factory) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -662,8 +632,7 @@ bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, } } -bool CefClearSchemeHandlerFactories() -{ +bool CefClearSchemeHandlerFactories() { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; diff --git a/libcef/simple_clipboard_impl.cc b/libcef/simple_clipboard_impl.cc index aff70ecf2..67fe7e7b6 100644 --- a/libcef/simple_clipboard_impl.cc +++ b/libcef/simple_clipboard_impl.cc @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "simple_clipboard_impl.h" - -#include +#include "libcef/simple_clipboard_impl.h" #include "base/lazy_instance.h" #include "base/stl_util.h" diff --git a/libcef/simple_clipboard_impl.h b/libcef/simple_clipboard_impl.h index 7cc7be9bd..ec8445f25 100644 --- a/libcef/simple_clipboard_impl.h +++ b/libcef/simple_clipboard_impl.h @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SIMPLE_CLIPBOARD_IMPL_H_ -#define SIMPLE_CLIPBOARD_IMPL_H_ +#ifndef CEF_LIBCEF_SIMPLE_CLIPBOARD_IMPL_H_ +#define CEF_LIBCEF_SIMPLE_CLIPBOARD_IMPL_H_ +#pragma once + +#include +#include #include "base/compiler_specific.h" #include "webkit/glue/clipboard_client.h" @@ -35,4 +39,4 @@ class SimpleClipboardClient : public webkit_glue::ClipboardClient { virtual WriteContext* CreateWriteContext() OVERRIDE; }; -#endif // SIMPLE_CLIPBOARD_IMPL_H_ +#endif // CEF_LIBCEF_SIMPLE_CLIPBOARD_IMPL_H_ diff --git a/libcef/storage_impl.cc b/libcef/storage_impl.cc index 95345d5e2..8417c84c6 100644 --- a/libcef/storage_impl.cc +++ b/libcef/storage_impl.cc @@ -3,18 +3,17 @@ // be found in the LICENSE file. #include "include/cef_storage.h" -#include "cef_context.h" -#include "cef_thread.h" -#include "dom_storage_common.h" -#include "dom_storage_namespace.h" -#include "dom_storage_area.h" +#include "libcef/cef_context.h" +#include "libcef/cef_thread.h" +#include "libcef/dom_storage_common.h" +#include "libcef/dom_storage_namespace.h" +#include "libcef/dom_storage_area.h" namespace { void UIT_VisitStorage(int64 namespace_id, const CefString& origin, const CefString& key, - CefRefPtr visitor) -{ + CefRefPtr visitor) { REQUIRE_UIT(); DOMStorageContext* context = _Context->storage_context(); @@ -100,7 +99,7 @@ void UIT_VisitStorage(int64 namespace_id, const CefString& origin, } else { // Visit all keys. len = area->Length(); - for(i = 0; i < len && !stop; ++i) { + for (i = 0; i < len && !stop; ++i) { keyVal = area->Key(i); if (keyVal.is_null()) { keyStr.clear(); @@ -133,8 +132,7 @@ void UIT_VisitStorage(int64 namespace_id, const CefString& origin, } } -void UIT_SetStoragePath(int64 namespace_id, const CefString& path) -{ +void UIT_SetStoragePath(int64 namespace_id, const CefString& path) { REQUIRE_UIT(); if (namespace_id != kLocalStorageNamespaceId) @@ -150,12 +148,11 @@ void UIT_SetStoragePath(int64 namespace_id, const CefString& path) context->SetLocalStoragePath(file_path); } -} // anonymous +} // namespace bool CefVisitStorage(CefStorageType type, const CefString& origin, const CefString& key, - CefRefPtr visitor) -{ + CefRefPtr visitor) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -165,7 +162,7 @@ bool CefVisitStorage(CefStorageType type, const CefString& origin, int64 namespace_id; if (type == ST_LOCALSTORAGE) { namespace_id = kLocalStorageNamespaceId; - } else if(type == ST_SESSIONSTORAGE) { + } else if (type == ST_SESSIONSTORAGE) { namespace_id = kLocalStorageNamespaceId + 1; } else { NOTREACHED() << "invalid type"; @@ -183,8 +180,7 @@ bool CefVisitStorage(CefStorageType type, const CefString& origin, } bool CefSetStorage(CefStorageType type, const CefString& origin, - const CefString& key, const CefString& value) -{ + const CefString& key, const CefString& value) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -200,7 +196,7 @@ bool CefSetStorage(CefStorageType type, const CefString& origin, int64 namespace_id; if (type == ST_LOCALSTORAGE) { namespace_id = kLocalStorageNamespaceId; - } else if(type == ST_SESSIONSTORAGE) { + } else if (type == ST_SESSIONSTORAGE) { namespace_id = kLocalStorageNamespaceId + 1; } else { NOTREACHED() << "invalid type"; @@ -223,8 +219,7 @@ bool CefSetStorage(CefStorageType type, const CefString& origin, } bool CefDeleteStorage(CefStorageType type, const CefString& origin, - const CefString& key) -{ + const CefString& key) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; @@ -240,7 +235,7 @@ bool CefDeleteStorage(CefStorageType type, const CefString& origin, int64 namespace_id; if (type == ST_LOCALSTORAGE) { namespace_id = kLocalStorageNamespaceId; - } else if(type == ST_SESSIONSTORAGE) { + } else if (type == ST_SESSIONSTORAGE) { namespace_id = kLocalStorageNamespaceId + 1; } else { NOTREACHED() << "invalid type"; @@ -259,7 +254,7 @@ bool CefDeleteStorage(CefStorageType type, const CefString& origin, context->DeleteAllLocalStorageFiles(); else context->PurgeMemory(namespace_id); - } else if(key.empty()) { + } else if (key.empty()) { // Clear the storage area for the specified origin. if (namespace_id == kLocalStorageNamespaceId) { context->DeleteLocalStorageForOrigin(origin); @@ -283,8 +278,7 @@ bool CefDeleteStorage(CefStorageType type, const CefString& origin, return true; } -bool CefSetStoragePath(CefStorageType type, const CefString& path) -{ +bool CefSetStoragePath(CefStorageType type, const CefString& path) { // Verify that the context is in a valid state. if (!CONTEXT_STATE_VALID()) { NOTREACHED() << "context not valid"; diff --git a/libcef/stream_impl.cc b/libcef/stream_impl.cc index b917e6e00..2f5afee1a 100644 --- a/libcef/stream_impl.cc +++ b/libcef/stream_impl.cc @@ -2,62 +2,57 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "stream_impl.h" -#include "base/logging.h" +#include "libcef/stream_impl.h" #include +#include "base/logging.h" // Static functions CefRefPtr CefStreamReader::CreateForFile( - const CefString& fileName) -{ + const CefString& fileName) { CefRefPtr reader; std::string fileNameStr = fileName; - FILE *file = fopen(fileNameStr.c_str(), "rb"); - if(file) + FILE* file = fopen(fileNameStr.c_str(), "rb"); + if (file) reader = new CefFileReader(file, true); return reader; } CefRefPtr CefStreamReader::CreateForData(void* data, - size_t size) -{ + size_t size) { DCHECK(data != NULL); - DCHECK(size > 0); + DCHECK(size > 0); // NOLINT(readability/check) CefRefPtr reader; - if(data && size > 0) + if (data && size > 0) reader = new CefBytesReader(data, size, true); return reader; } CefRefPtr CefStreamReader::CreateForHandler( - CefRefPtr handler) -{ + CefRefPtr handler) { DCHECK(handler.get()); CefRefPtr reader; - if(handler.get()) + if (handler.get()) reader = new CefHandlerReader(handler); return reader; } CefRefPtr CefStreamWriter::CreateForFile( - const CefString& fileName) -{ + const CefString& fileName) { DCHECK(!fileName.empty()); CefRefPtr writer; std::string fileNameStr = fileName; - FILE *file = fopen(fileNameStr.c_str(), "wb"); - if(file) + FILE* file = fopen(fileNameStr.c_str(), "wb"); + if (file) writer = new CefFileWriter(file, true); return writer; } CefRefPtr CefStreamWriter::CreateForHandler( - CefRefPtr handler) -{ + CefRefPtr handler) { DCHECK(handler.get()); CefRefPtr writer; - if(handler.get()) + if (handler.get()) writer = new CefHandlerWriter(handler); return writer; } @@ -66,37 +61,39 @@ CefRefPtr CefStreamWriter::CreateForHandler( // CefFileReader CefFileReader::CefFileReader(FILE* file, bool close) - : close_(close), file_(file) -{ + : close_(close), file_(file) { } -CefFileReader::~CefFileReader() -{ +CefFileReader::~CefFileReader() { AutoLock lock_scope(this); - if(close_) + if (close_) fclose(file_); } -size_t CefFileReader::Read(void* ptr, size_t size, size_t n) -{ +size_t CefFileReader::Read(void* ptr, size_t size, size_t n) { AutoLock lock_scope(this); return fread(ptr, size, n, file_); } -int CefFileReader::Seek(long offset, int whence) -{ +int CefFileReader::Seek(int64 offset, int whence) { AutoLock lock_scope(this); +#if defined(OS_WIN) + return _fseeki64(file_, offset, whence); +#else return fseek(file_, offset, whence); +#endif } -long CefFileReader::Tell() -{ +int64 CefFileReader::Tell() { AutoLock lock_scope(this); +#if defined(OS_WIN) + return _ftelli64(file_); +#else return ftell(file_); +#endif } -int CefFileReader::Eof() -{ +int CefFileReader::Eof() { AutoLock lock_scope(this); return feof(file_); } @@ -105,37 +102,32 @@ int CefFileReader::Eof() // CefFileWriter CefFileWriter::CefFileWriter(FILE* file, bool close) - : file_(file), close_(close) -{ + : file_(file), + close_(close) { } -CefFileWriter::~CefFileWriter() -{ +CefFileWriter::~CefFileWriter() { AutoLock lock_scope(this); - if(close_) + if (close_) fclose(file_); } -size_t CefFileWriter::Write(const void* ptr, size_t size, size_t n) -{ +size_t CefFileWriter::Write(const void* ptr, size_t size, size_t n) { AutoLock lock_scope(this); return (size_t)fwrite(ptr, size, n, file_); } -int CefFileWriter::Seek(long offset, int whence) -{ +int CefFileWriter::Seek(int64 offset, int whence) { AutoLock lock_scope(this); return fseek(file_, offset, whence); } -long CefFileWriter::Tell() -{ +int64 CefFileWriter::Tell() { AutoLock lock_scope(this); return ftell(file_); } -int CefFileWriter::Flush() -{ +int CefFileWriter::Flush() { AutoLock lock_scope(this); return fflush(file_); } @@ -143,84 +135,79 @@ int CefFileWriter::Flush() // CefBytesReader -CefBytesReader::CefBytesReader(void* data, long datasize, bool copy) - : data_(NULL), datasize_(0), copy_(false), offset_(0) -{ +CefBytesReader::CefBytesReader(void* data, int64 datasize, bool copy) + : data_(NULL), + datasize_(0), + copy_(false), + offset_(0) { SetData(data, datasize, copy); } -CefBytesReader::~CefBytesReader() -{ +CefBytesReader::~CefBytesReader() { SetData(NULL, 0, false); } -size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) -{ +size_t CefBytesReader::Read(void* ptr, size_t size, size_t n) { AutoLock lock_scope(this); size_t s = (datasize_ - offset_) / size; size_t ret = (n < s ? n : s); - memcpy(ptr, ((char*)data_) + offset_, ret * size); + memcpy(ptr, (reinterpret_cast(data_)) + offset_, ret * size); offset_ += ret * size; return ret; } -int CefBytesReader::Seek(long offset, int whence) -{ +int CefBytesReader::Seek(int64 offset, int whence) { int rv = -1L; AutoLock lock_scope(this); - switch(whence) { + switch (whence) { case SEEK_CUR: - if(offset_ + offset > datasize_) { - break; - } + if (offset_ + offset > datasize_ || offset_ + offset < 0) + break; offset_ += offset; rv = 0; break; - case SEEK_END: - if(offset > (int)datasize_) { + case SEEK_END: { + int64 offset_abs = abs(offset); + if (offset_abs > datasize_) break; - } - offset_ = datasize_ - offset; + offset_ = datasize_ - offset_abs; rv = 0; break; + } case SEEK_SET: - if(offset > (int)datasize_) { - break; - } + if (offset > datasize_ || offset < 0) + break; offset_ = offset; rv = 0; break; } - - return rv; + + return rv; } -long CefBytesReader::Tell() -{ +int64 CefBytesReader::Tell() { AutoLock lock_scope(this); return offset_; } -int CefBytesReader::Eof() -{ +int CefBytesReader::Eof() { AutoLock lock_scope(this); return (offset_ >= datasize_); } - -void CefBytesReader::SetData(void* data, long datasize, bool copy) -{ + +void CefBytesReader::SetData(void* data, int64 datasize, bool copy) { AutoLock lock_scope(this); - if(copy_) + if (copy_) free(data_); - + copy_ = copy; offset_ = 0; datasize_ = datasize; - if(copy) { + if (copy) { data_ = malloc(datasize); DCHECK(data_ != NULL); - if(data_) + if (data_) memcpy(data_, data, datasize); } else { data_ = data; @@ -231,28 +218,28 @@ void CefBytesReader::SetData(void* data, long datasize, bool copy) // CefBytesWriter CefBytesWriter::CefBytesWriter(size_t grow) - : grow_(grow), datasize_(grow), offset_(0) -{ - DCHECK(grow > 0); + : grow_(grow), + datasize_(grow), + offset_(0) { + DCHECK(grow > 0); // NOLINT(readability/check) data_ = malloc(grow); DCHECK(data_ != NULL); } -CefBytesWriter::~CefBytesWriter() -{ +CefBytesWriter::~CefBytesWriter() { AutoLock lock_scope(this); - if(data_) + if (data_) free(data_); } -size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) -{ +size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) { AutoLock lock_scope(this); size_t rv; - if(offset_ + size * n >= datasize_ && Grow(size * n) == 0) { + if (offset_ + static_cast(size * n) >= datasize_ && + Grow(size * n) == 0) { rv = 0; } else { - memcpy(((char*)data_) + offset_, ptr, size * n); + memcpy(reinterpret_cast(data_) + offset_, ptr, size * n); offset_ += size * n; rv = n; } @@ -260,68 +247,63 @@ size_t CefBytesWriter::Write(const void* ptr, size_t size, size_t n) return rv; } -int CefBytesWriter::Seek(long offset, int whence) -{ +int CefBytesWriter::Seek(int64 offset, int whence) { int rv = -1L; AutoLock lock_scope(this); - switch(whence) { + switch (whence) { case SEEK_CUR: - if(offset_ + offset > datasize_) { - break; - } - offset_ += offset; - rv = offset_; - break; - case SEEK_END: - if(offset > (int)datasize_) { + if (offset_ + offset > datasize_ || offset_ + offset < 0) break; - } - offset_ = datasize_ - offset; - rv = offset_; - case SEEK_SET: - if(offset > (int)datasize_) { - break; - } - offset_ = offset; - rv = offset_; + offset_ += offset; + rv = 0; + break; + case SEEK_END: { + int64 offset_abs = abs(offset); + if (offset_abs > datasize_) + break; + offset_ = datasize_ - offset_abs; + rv = 0; break; } - - return rv; + case SEEK_SET: + if (offset > datasize_ || offset < 0) + break; + offset_ = offset; + rv = 0; + break; + } + + return rv; } -long CefBytesWriter::Tell() -{ +int64 CefBytesWriter::Tell() { AutoLock lock_scope(this); return offset_; } -int CefBytesWriter::Flush() -{ +int CefBytesWriter::Flush() { return 0; } -std::string CefBytesWriter::GetDataString() -{ +std::string CefBytesWriter::GetDataString() { AutoLock lock_scope(this); - std::string str((char*)data_, offset_); + std::string str(reinterpret_cast(data_), offset_); return str; } -size_t CefBytesWriter::Grow(size_t size) -{ +size_t CefBytesWriter::Grow(size_t size) { AutoLock lock_scope(this); size_t rv; size_t s = (size > grow_ ? size : grow_); - void* tmp = realloc(data_, datasize_ + s); + void* tmp = realloc(data_, datasize_ + s); DCHECK(tmp != NULL); - if(tmp) { - data_ = tmp; - datasize_ += s; + if (tmp) { + data_ = tmp; + datasize_ += s; rv = datasize_; } else { rv = 0; } - return rv; + return rv; } diff --git a/libcef/stream_impl.h b/libcef/stream_impl.h index daa9b8c64..034baa7d9 100644 --- a/libcef/stream_impl.h +++ b/libcef/stream_impl.h @@ -2,46 +2,46 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _STREAM_IMPL_H -#define _STREAM_IMPL_H +#ifndef CEF_LIBCEF_STREAM_IMPL_H_ +#define CEF_LIBCEF_STREAM_IMPL_H_ +#pragma once -#include "include/cef_stream.h" #include +#include +#include "include/cef_stream.h" // Implementation of CefStreamReader for files. -class CefFileReader : public CefStreamReader -{ -public: +class CefFileReader : public CefStreamReader { + public: CefFileReader(FILE* file, bool close); virtual ~CefFileReader(); virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Eof() OVERRIDE; - -protected: + + protected: bool close_; - FILE *file_; + FILE* file_; IMPLEMENT_REFCOUNTING(CefFileReader); IMPLEMENT_LOCKING(CefFileReader); }; // Implementation of CefStreamWriter for files. -class CefFileWriter : public CefStreamWriter -{ -public: +class CefFileWriter : public CefStreamWriter { + public: CefFileWriter(FILE* file, bool close); virtual ~CefFileWriter(); virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Flush() OVERRIDE; - -protected: - FILE *file_; + + protected: + FILE* file_; bool close_; IMPLEMENT_REFCOUNTING(CefFileWriter); @@ -49,116 +49,106 @@ protected: }; // Implementation of CefStreamReader for byte buffers. -class CefBytesReader : public CefStreamReader -{ -public: - CefBytesReader(void* data, long datasize, bool copy); +class CefBytesReader : public CefStreamReader { + public: + CefBytesReader(void* data, int64 datasize, bool copy); virtual ~CefBytesReader(); virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Eof() OVERRIDE; - - void SetData(void* data, long datasize, bool copy); + + void SetData(void* data, int64 datasize, bool copy); void* GetData() { return data_; } size_t GetDataSize() { return offset_; } -protected: - void* data_; - size_t datasize_; + protected: + void* data_; + int64 datasize_; bool copy_; - size_t offset_; + int64 offset_; IMPLEMENT_REFCOUNTING(CefBytesReader); IMPLEMENT_LOCKING(CefBytesReader); }; // Implementation of CefStreamWriter for byte buffers. -class CefBytesWriter : public CefStreamWriter -{ -public: - CefBytesWriter(size_t grow); +class CefBytesWriter : public CefStreamWriter { + public: + explicit CefBytesWriter(size_t grow); virtual ~CefBytesWriter(); virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Flush() OVERRIDE; void* GetData() { return data_; } - size_t GetDataSize() { return offset_; } + int64 GetDataSize() { return offset_; } std::string GetDataString(); - -protected: - size_t Grow(size_t size); + + protected: + size_t Grow(size_t size); size_t grow_; void* data_; - size_t datasize_; - size_t offset_; + int64 datasize_; + int64 offset_; IMPLEMENT_REFCOUNTING(CefBytesWriter); IMPLEMENT_LOCKING(CefBytesWriter); }; // Implementation of CefStreamReader for handlers. -class CefHandlerReader : public CefStreamReader -{ -public: - CefHandlerReader(CefRefPtr handler) : handler_(handler) {} +class CefHandlerReader : public CefStreamReader { + public: + explicit CefHandlerReader(CefRefPtr handler) + : handler_(handler) {} - virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE - { + virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE { return handler_->Read(ptr, size, n); } - virtual int Seek(long offset, int whence) OVERRIDE - { + virtual int Seek(int64 offset, int whence) OVERRIDE { return handler_->Seek(offset, whence); } - virtual long Tell() OVERRIDE - { + virtual int64 Tell() OVERRIDE { return handler_->Tell(); } - virtual int Eof() OVERRIDE - { + virtual int Eof() OVERRIDE { return handler_->Eof(); } - -protected: + + protected: CefRefPtr handler_; IMPLEMENT_REFCOUNTING(CefHandlerReader); }; // Implementation of CefStreamWriter for handlers. -class CefHandlerWriter : public CefStreamWriter -{ -public: - CefHandlerWriter(CefRefPtr handler) : handler_(handler) {} +class CefHandlerWriter : public CefStreamWriter { + public: + explicit CefHandlerWriter(CefRefPtr handler) + : handler_(handler) {} - virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE - { + virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE { return handler_->Write(ptr, size, n); } - virtual int Seek(long offset, int whence) OVERRIDE - { + virtual int Seek(int64 offset, int whence) OVERRIDE { return handler_->Seek(offset, whence); } - virtual long Tell() OVERRIDE - { + virtual int64 Tell() OVERRIDE { return handler_->Tell(); } - virtual int Flush() OVERRIDE - { + virtual int Flush() OVERRIDE { return handler_->Flush(); } - -protected: + + protected: CefRefPtr handler_; IMPLEMENT_REFCOUNTING(CefHandlerWriter); }; -#endif // _STREAM_IMPL_H +#endif // CEF_LIBCEF_STREAM_IMPL_H_ diff --git a/libcef/task_impl.cc b/libcef/task_impl.cc index aed9f8040..a8cd804f0 100644 --- a/libcef/task_impl.cc +++ b/libcef/task_impl.cc @@ -3,13 +3,12 @@ // be found in the LICENSE file. #include "include/cef_task.h" -#include "cef_thread.h" +#include "libcef/cef_thread.h" namespace { -int GetThreadId(CefThreadId threadId) -{ - switch(threadId) { +int GetThreadId(CefThreadId threadId) { + switch (threadId) { case TID_UI: return CefThread::UI; case TID_IO: return CefThread::IO; case TID_FILE: return CefThread::FILE; @@ -18,33 +17,30 @@ int GetThreadId(CefThreadId threadId) return -1; } -} // anonymous +} // namespace -bool CefCurrentlyOn(CefThreadId threadId) -{ +bool CefCurrentlyOn(CefThreadId threadId) { int id = GetThreadId(threadId); - if(id < 0) + if (id < 0) return false; return CefThread::CurrentlyOn(static_cast(id)); } -class CefTaskHelper : public Task -{ -public: +class CefTaskHelper : public Task { + public: CefTaskHelper(CefRefPtr task, CefThreadId threadId) : task_(task), thread_id_(threadId) {} virtual void Run() { task_->Execute(thread_id_); } -private: + private: CefRefPtr task_; CefThreadId thread_id_; DISALLOW_COPY_AND_ASSIGN(CefTaskHelper); }; -bool CefPostTask(CefThreadId threadId, CefRefPtr task) -{ +bool CefPostTask(CefThreadId threadId, CefRefPtr task) { int id = GetThreadId(threadId); - if(id < 0) + if (id < 0) return false; return CefThread::PostTask(static_cast(id), FROM_HERE, @@ -52,10 +48,9 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr task) } bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, - long delay_ms) -{ + int64 delay_ms) { int id = GetThreadId(threadId); - if(id < 0) + if (id < 0) return false; return CefThread::PostDelayedTask(static_cast(id), FROM_HERE, diff --git a/libcef/tracker.h b/libcef/tracker.h index ad52b9f18..6cfdcb270 100644 --- a/libcef/tracker.h +++ b/libcef/tracker.h @@ -2,38 +2,35 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _TRACKER_H -#define _TRACKER_H +#ifndef CEF_LIBCEF_TRACKER_H_ +#define CEF_LIBCEF_TRACKER_H_ +#pragma once #include "include/cef_base.h" // Class extended by objects that must be tracked. After creating a tracked // object you should add it to the appropriate track manager. -class CefTrackObject -{ -public: - CefTrackObject() - { +class CefTrackObject { + public: + CefTrackObject() { track_next_ = NULL; track_prev_ = NULL; } - virtual ~CefTrackObject() - { + virtual ~CefTrackObject() { } // Returns true if the object is currently being tracked. bool IsTracked() { return (track_prev_ || track_next_); } -private: + private: CefTrackObject* GetTrackPrev() { return track_prev_; } void SetTrackPrev(CefTrackObject* base) { track_prev_ = base; } CefTrackObject* GetTrackNext() { return track_next_; } void SetTrackNext(CefTrackObject* base) { track_next_ = base; } // Insert a new object into the tracking list before this object. - void InsertTrackPrev(CefTrackObject* object) - { - if(track_prev_) + void InsertTrackPrev(CefTrackObject* object) { + if (track_prev_) track_prev_->SetTrackNext(object); object->SetTrackNext(this); object->SetTrackPrev(track_prev_); @@ -41,9 +38,8 @@ private: } // Insert a new object into the tracking list after this object. - void InsertTrackNext(CefTrackObject* object) - { - if(track_next_) + void InsertTrackNext(CefTrackObject* object) { + if (track_next_) track_next_->SetTrackPrev(object); object->SetTrackPrev(this); object->SetTrackNext(track_next_); @@ -51,17 +47,16 @@ private: } // Remove this object from the tracking list. - void RemoveTracking() - { - if(track_next_) + void RemoveTracking() { + if (track_next_) track_next_->SetTrackPrev(track_prev_); - if(track_prev_) + if (track_prev_) track_prev_->SetTrackNext(track_next_); track_next_ = NULL; track_prev_ = NULL; } -private: + private: CefTrackObject* track_next_; CefTrackObject* track_prev_; @@ -74,20 +69,17 @@ private: // manager object is destroyed. A manager object can be created as either a // member variable of another class or by using lazy initialization: // base::LazyInstance g_singleton = LAZY_INSTANCE_INITIALIZER; -class CefTrackManager : public CefBase -{ -public: +class CefTrackManager : public CefBase { + public: CefTrackManager() : object_count_(0) {} - virtual ~CefTrackManager() - { + virtual ~CefTrackManager() { DeleteAll(); } // Add an object to be tracked by this manager. - void Add(CefTrackObject* object) - { + void Add(CefTrackObject* object) { Lock(); - if(!object->IsTracked()) { + if (!object->IsTracked()) { tracker_.InsertTrackNext(object); ++object_count_; } @@ -95,11 +87,10 @@ public: } // Delete an object tracked by this manager. - bool Delete(CefTrackObject* object) - { + bool Delete(CefTrackObject* object) { bool rv = false; Lock(); - if(object->IsTracked()) { + if (object->IsTracked()) { object->RemoveTracking(); delete object; --object_count_; @@ -108,32 +99,31 @@ public: Unlock(); return rv; } - + // Delete all objects tracked by this manager. - void DeleteAll() - { + void DeleteAll() { Lock(); CefTrackObject* next; do { next = tracker_.GetTrackNext(); - if(next) { + if (next) { next->RemoveTracking(); delete next; } - } while(next != NULL); + } while (next != NULL); object_count_ = 0; Unlock(); } // Returns the number of objects currently being tracked. - long GetCount() { return object_count_; } + int GetCount() { return object_count_; } -private: + private: CefTrackObject tracker_; - long object_count_; + int object_count_; IMPLEMENT_REFCOUNTING(CefTrackManager); IMPLEMENT_LOCKING(CefTrackManager); }; -#endif // _TRACKER_H +#endif // CEF_LIBCEF_TRACKER_H_ diff --git a/libcef/url_impl.cc b/libcef/url_impl.cc index d1a8af10a..4ba6818ab 100644 --- a/libcef/url_impl.cc +++ b/libcef/url_impl.cc @@ -2,14 +2,12 @@ // reserved. Use of this source code is governed by a BSD-style license that can // be found in the LICENSE file. -#include "include/cef_url.h" - -#include "googleurl/src/gurl.h" #include +#include "include/cef_url.h" +#include "googleurl/src/gurl.h" bool CefParseURL(const CefString& url, - CefURLParts& parts) -{ + CefURLParts& parts) { GURL gurl(url.ToString()); if (!gurl.is_valid()) return false; @@ -27,8 +25,7 @@ bool CefParseURL(const CefString& url, } bool CefCreateURL(const CefURLParts& parts, - CefString& url) -{ + CefString& url) { std::string spec = CefString(parts.spec.str, parts.spec.length, false); std::string scheme = CefString(parts.scheme.str, parts.scheme.length, false); std::string username = diff --git a/libcef/v8_impl.cc b/libcef/v8_impl.cc index 8aceb8441..bf5734759 100644 --- a/libcef/v8_impl.cc +++ b/libcef/v8_impl.cc @@ -2,10 +2,10 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "browser_impl.h" -#include "v8_impl.h" -#include "cef_context.h" -#include "tracker.h" +#include "libcef/v8_impl.h" +#include "libcef/browser_impl.h" +#include "libcef/cef_context.h" +#include "libcef/tracker.h" #include "base/lazy_instance.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" @@ -34,50 +34,44 @@ static const char kCefUserData[] = "Cef::UserData"; base::LazyInstance g_v8_tracker = LAZY_INSTANCE_INITIALIZER; -class TrackBase : public CefTrackObject -{ -public: - TrackBase(CefBase* base) { base_ = base; } +class TrackBase : public CefTrackObject { + public: + explicit TrackBase(CefBase* base) { base_ = base; } -protected: + protected: CefRefPtr base_; }; -class TrackBase2 : public TrackBase -{ -public: - TrackBase2(CefBase* base, CefBase* base2): TrackBase(base) { - base2_ = base2; +class TrackBase2 : public TrackBase { + public: + TrackBase2(CefBase* base, CefBase* base2): TrackBase(base) { + base2_ = base2; } -protected: + protected: CefRefPtr base2_; }; -class TrackString : public CefTrackObject -{ -public: - TrackString(const std::string& str) : string_(str) {} +class TrackString : public CefTrackObject { + public: + explicit TrackString(const std::string& str) : string_(str) {} const char* GetString() { return string_.c_str(); } -private: + private: std::string string_; }; -void TrackAdd(CefTrackObject* object) -{ +void TrackAdd(CefTrackObject* object) { g_v8_tracker.Pointer()->Add(object); } -void TrackDelete(CefTrackObject* object) -{ +void TrackDelete(CefTrackObject* object) { g_v8_tracker.Pointer()->Delete(object); } // Callback for weak persistent reference destruction. -void TrackDestructor(v8::Persistent object, void* parameter) -{ - if(parameter) +void TrackDestructor(v8::Persistent object, void* parameter) { + if (parameter) TrackDelete(static_cast(parameter)); object.Dispose(); object.Clear(); @@ -85,10 +79,9 @@ void TrackDestructor(v8::Persistent object, void* parameter) // Return the browser associated with the specified WebFrame. -CefRefPtr FindBrowserForFrame(WebKit::WebFrame *frame) -{ +CefRefPtr FindBrowserForFrame(WebKit::WebFrame *frame) { CefContext::AutoLock lock_scope(_Context); - + CefContext::BrowserList *list = _Context->GetBrowserList(); CefContext::BrowserList::const_iterator i; i = list->begin(); @@ -102,8 +95,7 @@ CefRefPtr FindBrowserForFrame(WebKit::WebFrame *frame) } // Convert a CefString to a V8::String. -v8::Handle GetV8String(const CefString& str) -{ +v8::Handle GetV8String(const CefString& str) { #if defined(CEF_STRING_TYPE_UTF16) // Already a UTF16 string. return v8::String::New( @@ -121,32 +113,29 @@ v8::Handle GetV8String(const CefString& str) } #if defined(CEF_STRING_TYPE_UTF16) -void v8impl_string_dtor(char16* str) -{ +void v8impl_string_dtor(char16* str) { delete [] str; } #elif defined(CEF_STRING_TYPE_UTF8) -void v8impl_string_dtor(char* str) -{ +void v8impl_string_dtor(char* str) { delete [] str; } #endif // Convert a v8::String to CefString. -void GetCefString(v8::Handle str, CefString& out) -{ +void GetCefString(v8::Handle str, CefString& out) { #if defined(CEF_STRING_TYPE_WIDE) // Allocate enough space for a worst-case conversion. int len = str->Utf8Length(); char* buf = new char[len + 1]; str->WriteUtf8(buf, len + 1); - + // Perform conversion to the wide type. cef_string_t* retws = out.GetWritableStruct(); cef_string_utf8_to_wide(buf, len, retws); - + delete [] buf; -#else // !defined(CEF_STRING_TYPE_WIDE) +#else // !defined(CEF_STRING_TYPE_WIDE) #if defined(CEF_STRING_TYPE_UTF16) int len = str->Length(); char16* buf = new char16[len + 1]; @@ -164,19 +153,18 @@ void GetCefString(v8::Handle str, CefString& out) retws->str = buf; retws->length = len; retws->dtor = v8impl_string_dtor; -#endif // !defined(CEF_STRING_TYPE_WIDE) +#endif // !defined(CEF_STRING_TYPE_WIDE) } // V8 function callback. -v8::Handle FunctionCallbackImpl(const v8::Arguments& args) -{ +v8::Handle FunctionCallbackImpl(const v8::Arguments& args) { v8::HandleScope handle_scope; CefV8Handler* handler = static_cast(v8::External::Unwrap(args.Data())); CefV8ValueList params; - for(int i = 0; i < args.Length(); i++) + for (int i = 0; i < args.Length(); i++) params.push_back(new CefV8ValueImpl(args[i])); CefString func_name; @@ -186,10 +174,10 @@ v8::Handle FunctionCallbackImpl(const v8::Arguments& args) CefRefPtr retval; CefString exception; - if(handler->Execute(func_name, object, params, retval, exception)) { - if (!exception.empty()) + if (handler->Execute(func_name, object, params, retval, exception)) { + if (!exception.empty()) { return v8::ThrowException(v8::Exception::Error(GetV8String(exception))); - else { + } else { CefV8ValueImpl* rv = static_cast(retval.get()); if (rv) return rv->GetHandle(); @@ -201,8 +189,7 @@ v8::Handle FunctionCallbackImpl(const v8::Arguments& args) // V8 Accessor callbacks v8::Handle AccessorGetterCallbackImpl(v8::Local property, - const v8::AccessorInfo& info) -{ + const v8::AccessorInfo& info) { v8::HandleScope handle_scope; v8::Handle obj = info.This(); @@ -230,8 +217,7 @@ v8::Handle AccessorGetterCallbackImpl(v8::Local property, void AccessorSetterCallbackImpl(v8::Local property, v8::Local value, - const v8::AccessorInfo& info) -{ + const v8::AccessorInfo& info) { v8::HandleScope handle_scope; v8::Handle obj = info.This(); @@ -253,21 +239,19 @@ void AccessorSetterCallbackImpl(v8::Local property, // V8 extension registration. class ExtensionWrapper : public v8::Extension { -public: + public: ExtensionWrapper(const char* extension_name, const char* javascript_code, CefV8Handler* handler) - : v8::Extension(extension_name, javascript_code), handler_(handler) - { + : v8::Extension(extension_name, javascript_code), handler_(handler) { if (handler) { // The reference will be released when the application exits. TrackAdd(new TrackBase(handler)); } } - + virtual v8::Handle GetNativeFunction( - v8::Handle name) - { + v8::Handle name) { if (!handler_) return v8::Handle(); @@ -275,8 +259,7 @@ public: v8::External::Wrap(handler_)); } - void UIT_RegisterExtension() - { + void UIT_RegisterExtension() { WebKit::WebScriptController::registerExtension(this); } @@ -285,20 +268,18 @@ public: static bool ImplementsThreadSafeReferenceCounting() { return true; } -private: + private: CefV8Handler* handler_; }; -class CefV8ExceptionImpl : public CefV8Exception -{ -public: +class CefV8ExceptionImpl : public CefV8Exception { + public: explicit CefV8ExceptionImpl(v8::Handle message) : line_number_(0), start_position_(0), end_position_(0), start_column_(0), - end_column_(0) - { + end_column_(0) { if (message.IsEmpty()) return; @@ -324,7 +305,7 @@ public: virtual int GetStartColumn() OVERRIDE { return start_column_; } virtual int GetEndColumn() OVERRIDE { return end_column_; } -protected: + protected: CefString message_; CefString source_line_; CefString script_; @@ -337,12 +318,11 @@ protected: IMPLEMENT_REFCOUNTING(CefV8ExceptionImpl); }; -} // namespace +} // namespace bool CefRegisterExtension(const CefString& extension_name, const CefString& javascript_code, - CefRefPtr handler) -{ + CefRefPtr handler) { // Verify that the context is in a valid state. CEF_REQUIRE_VALID_CONTEXT(false); @@ -350,10 +330,10 @@ bool CefRegisterExtension(const CefString& extension_name, TrackAdd(name); TrackString* code = new TrackString(javascript_code); TrackAdd(code); - + ExtensionWrapper* wrapper = new ExtensionWrapper(name->GetString(), code->GetString(), handler.get()); - + CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(wrapper, &ExtensionWrapper::UIT_RegisterExtension)); return true; @@ -363,8 +343,7 @@ bool CefRegisterExtension(const CefString& extension_name, // CefV8Context // static -CefRefPtr CefV8Context::GetCurrentContext() -{ +CefRefPtr CefV8Context::GetCurrentContext() { CefRefPtr context; CEF_REQUIRE_VALID_CONTEXT(context); CEF_REQUIRE_UI_THREAD(context); @@ -376,8 +355,7 @@ CefRefPtr CefV8Context::GetCurrentContext() } // static -CefRefPtr CefV8Context::GetEnteredContext() -{ +CefRefPtr CefV8Context::GetEnteredContext() { CefRefPtr context; CEF_REQUIRE_VALID_CONTEXT(context); CEF_REQUIRE_UI_THREAD(context); @@ -389,8 +367,7 @@ CefRefPtr CefV8Context::GetEnteredContext() } // static -bool CefV8Context::InContext() -{ +bool CefV8Context::InContext() { CEF_REQUIRE_VALID_CONTEXT(false); CEF_REQUIRE_UI_THREAD(false); return v8::Context::InContext(); @@ -403,17 +380,15 @@ CefV8ContextImpl::CefV8ContextImpl(v8::Handle context) #ifndef NDEBUG : enter_count_(0) #endif -{ +{ // NOLINT(whitespace/braces) v8_context_ = new CefV8ContextHandle(context); } -CefV8ContextImpl::~CefV8ContextImpl() -{ +CefV8ContextImpl::~CefV8ContextImpl() { DLOG_ASSERT(0 == enter_count_); } -CefRefPtr CefV8ContextImpl::GetBrowser() -{ +CefRefPtr CefV8ContextImpl::GetBrowser() { CefRefPtr browser; CEF_REQUIRE_UI_THREAD(browser); @@ -424,8 +399,7 @@ CefRefPtr CefV8ContextImpl::GetBrowser() return browser; } -CefRefPtr CefV8ContextImpl::GetFrame() -{ +CefRefPtr CefV8ContextImpl::GetFrame() { CefRefPtr frame; CEF_REQUIRE_UI_THREAD(frame); @@ -440,8 +414,7 @@ CefRefPtr CefV8ContextImpl::GetFrame() return frame; } -CefRefPtr CefV8ContextImpl::GetGlobal() -{ +CefRefPtr CefV8ContextImpl::GetGlobal() { CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -449,8 +422,7 @@ CefRefPtr CefV8ContextImpl::GetGlobal() return new CefV8ValueImpl(v8_context_->GetHandle()->Global()); } -bool CefV8ContextImpl::Enter() -{ +bool CefV8ContextImpl::Enter() { CEF_REQUIRE_UI_THREAD(false); v8_context_->GetHandle()->Enter(); #ifndef NDEBUG @@ -459,8 +431,7 @@ bool CefV8ContextImpl::Enter() return true; } -bool CefV8ContextImpl::Exit() -{ +bool CefV8ContextImpl::Exit() { CEF_REQUIRE_UI_THREAD(false); DLOG_ASSERT(enter_count_ > 0); v8_context_->GetHandle()->Exit(); @@ -470,8 +441,7 @@ bool CefV8ContextImpl::Exit() return true; } -bool CefV8ContextImpl::IsSame(CefRefPtr that) -{ +bool CefV8ContextImpl::IsSame(CefRefPtr that) { CEF_REQUIRE_UI_THREAD(false); v8::HandleScope handle_scope; @@ -479,20 +449,18 @@ bool CefV8ContextImpl::IsSame(CefRefPtr that) v8::Local thatHandle; v8::Local thisHandle = GetContext(); - CefV8ContextImpl *impl = static_cast(that.get()); + CefV8ContextImpl* impl = static_cast(that.get()); if (impl) thatHandle = impl->GetContext(); return (thisHandle == thatHandle); } -v8::Local CefV8ContextImpl::GetContext() -{ +v8::Local CefV8ContextImpl::GetContext() { return v8::Local::New(v8_context_->GetHandle()); } -WebKit::WebFrame* CefV8ContextImpl::GetWebFrame() -{ +WebKit::WebFrame* CefV8ContextImpl::GetWebFrame() { v8::HandleScope handle_scope; v8::Context::Scope context_scope(v8_context_->GetHandle()); WebKit::WebFrame* frame = WebKit::WebFrame::frameForCurrentContext(); @@ -504,9 +472,8 @@ WebKit::WebFrame* CefV8ContextImpl::GetWebFrame() // Custom destructor for a v8 value handle which gets called only on the UI // thread. -CefV8ValueHandle::~CefV8ValueHandle() -{ - if(tracker_) { +CefV8ValueHandle::~CefV8ValueHandle() { + if (tracker_) { TrackAdd(tracker_); v8_handle_.MakeWeak(tracker_, TrackDestructor); } else { @@ -520,8 +487,7 @@ CefV8ValueHandle::~CefV8ValueHandle() // CefV8Value // static -CefRefPtr CefV8Value::CreateUndefined() -{ +CefRefPtr CefV8Value::CreateUndefined() { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -529,8 +495,7 @@ CefRefPtr CefV8Value::CreateUndefined() } // static -CefRefPtr CefV8Value::CreateNull() -{ +CefRefPtr CefV8Value::CreateNull() { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -538,8 +503,7 @@ CefRefPtr CefV8Value::CreateNull() } // static -CefRefPtr CefV8Value::CreateBool(bool value) -{ +CefRefPtr CefV8Value::CreateBool(bool value) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -547,8 +511,7 @@ CefRefPtr CefV8Value::CreateBool(bool value) } // static -CefRefPtr CefV8Value::CreateInt(int value) -{ +CefRefPtr CefV8Value::CreateInt(int value) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -556,8 +519,7 @@ CefRefPtr CefV8Value::CreateInt(int value) } // static -CefRefPtr CefV8Value::CreateDouble(double value) -{ +CefRefPtr CefV8Value::CreateDouble(double value) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -565,8 +527,7 @@ CefRefPtr CefV8Value::CreateDouble(double value) } // static -CefRefPtr CefV8Value::CreateDate(const CefTime& date) -{ +CefRefPtr CefV8Value::CreateDate(const CefTime& date) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -575,8 +536,7 @@ CefRefPtr CefV8Value::CreateDate(const CefTime& date) } // static -CefRefPtr CefV8Value::CreateString(const CefString& value) -{ +CefRefPtr CefV8Value::CreateString(const CefString& value) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); v8::HandleScope handle_scope; @@ -585,8 +545,7 @@ CefRefPtr CefV8Value::CreateString(const CefString& value) // static CefRefPtr CefV8Value::CreateObject( - CefRefPtr user_data, CefRefPtr accessor) -{ + CefRefPtr user_data, CefRefPtr accessor) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); @@ -603,7 +562,7 @@ CefRefPtr CefV8Value::CreateObject( // Provide a tracker object that will cause the user data and/or accessor // reference to be released when the V8 object is destroyed. - TrackBase *tracker = NULL; + TrackBase* tracker = NULL; if (user_data.get() && accessor.get()) { tracker = new TrackBase2(user_data, accessor); } else if (user_data.get() || accessor.get()) { @@ -627,8 +586,7 @@ CefRefPtr CefV8Value::CreateObject( } // static -CefRefPtr CefV8Value::CreateArray() -{ +CefRefPtr CefV8Value::CreateArray() { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); @@ -644,9 +602,8 @@ CefRefPtr CefV8Value::CreateArray() } // static -CefRefPtr CefV8Value::CreateFunction(const CefString& name, - CefRefPtr handler) -{ +CefRefPtr CefV8Value::CreateFunction( + const CefString& name, CefRefPtr handler) { CEF_REQUIRE_VALID_CONTEXT(NULL); CEF_REQUIRE_UI_THREAD(NULL); @@ -692,78 +649,65 @@ CefRefPtr CefV8Value::CreateFunction(const CefString& name, // CefV8ValueImpl CefV8ValueImpl::CefV8ValueImpl(v8::Handle value, - CefTrackObject* tracker) -{ + CefTrackObject* tracker) { v8_value_ = new CefV8ValueHandle(value, tracker); } -CefV8ValueImpl::~CefV8ValueImpl() -{ +CefV8ValueImpl::~CefV8ValueImpl() { } -bool CefV8ValueImpl::IsUndefined() -{ +bool CefV8ValueImpl::IsUndefined() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsUndefined(); } -bool CefV8ValueImpl::IsNull() -{ +bool CefV8ValueImpl::IsNull() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsNull(); } -bool CefV8ValueImpl::IsBool() -{ +bool CefV8ValueImpl::IsBool() { CEF_REQUIRE_UI_THREAD(false); return (GetHandle()->IsBoolean() || GetHandle()->IsTrue() || GetHandle()->IsFalse()); } -bool CefV8ValueImpl::IsInt() -{ +bool CefV8ValueImpl::IsInt() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsInt32(); } -bool CefV8ValueImpl::IsDouble() -{ +bool CefV8ValueImpl::IsDouble() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsNumber(); } -bool CefV8ValueImpl::IsDate() -{ +bool CefV8ValueImpl::IsDate() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsDate(); } -bool CefV8ValueImpl::IsString() -{ +bool CefV8ValueImpl::IsString() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsString(); } -bool CefV8ValueImpl::IsObject() -{ +bool CefV8ValueImpl::IsObject() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsObject(); } -bool CefV8ValueImpl::IsArray() -{ +bool CefV8ValueImpl::IsArray() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsArray(); } -bool CefV8ValueImpl::IsFunction() -{ +bool CefV8ValueImpl::IsFunction() { CEF_REQUIRE_UI_THREAD(false); return GetHandle()->IsFunction(); } -bool CefV8ValueImpl::IsSame(CefRefPtr that) -{ +bool CefV8ValueImpl::IsSame(CefRefPtr that) { CEF_REQUIRE_UI_THREAD(false); v8::HandleScope handle_scope; @@ -771,19 +715,18 @@ bool CefV8ValueImpl::IsSame(CefRefPtr that) v8::Handle thatHandle; v8::Handle thisHandle = GetHandle(); - CefV8ValueImpl *impl = static_cast(that.get()); + CefV8ValueImpl* impl = static_cast(that.get()); if (impl) thatHandle = impl->GetHandle(); return (thisHandle == thatHandle); } -bool CefV8ValueImpl::GetBoolValue() -{ +bool CefV8ValueImpl::GetBoolValue() { CEF_REQUIRE_UI_THREAD(false); if (GetHandle()->IsTrue()) { return true; - } else if(GetHandle()->IsFalse()) { + } else if (GetHandle()->IsFalse()) { return false; } else { v8::HandleScope handle_scope; @@ -792,33 +735,29 @@ bool CefV8ValueImpl::GetBoolValue() } } -int CefV8ValueImpl::GetIntValue() -{ +int CefV8ValueImpl::GetIntValue() { CEF_REQUIRE_UI_THREAD(0); v8::HandleScope handle_scope; v8::Local val = GetHandle()->ToInt32(); return val->Value(); } -double CefV8ValueImpl::GetDoubleValue() -{ +double CefV8ValueImpl::GetDoubleValue() { CEF_REQUIRE_UI_THREAD(0.); v8::HandleScope handle_scope; v8::Local val = GetHandle()->ToNumber(); return val->Value(); } -CefTime CefV8ValueImpl::GetDateValue() -{ - CEF_REQUIRE_UI_THREAD(0.); +CefTime CefV8ValueImpl::GetDateValue() { + CEF_REQUIRE_UI_THREAD(CefTime(0.)); v8::HandleScope handle_scope; v8::Local val = GetHandle()->ToNumber(); // Convert from milliseconds to seconds. return CefTime(val->Value() / 1000); } -CefString CefV8ValueImpl::GetStringValue() -{ +CefString CefV8ValueImpl::GetStringValue() { CefString rv; CEF_REQUIRE_UI_THREAD(rv); v8::HandleScope handle_scope; @@ -826,10 +765,9 @@ CefString CefV8ValueImpl::GetStringValue() return rv; } -bool CefV8ValueImpl::HasValue(const CefString& key) -{ +bool CefV8ValueImpl::HasValue(const CefString& key) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } @@ -844,10 +782,9 @@ bool CefV8ValueImpl::HasValue(const CefString& key) return obj->Has(GetV8String(key)); } -bool CefV8ValueImpl::HasValue(int index) -{ +bool CefV8ValueImpl::HasValue(int index) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } @@ -861,10 +798,9 @@ bool CefV8ValueImpl::HasValue(int index) return obj->Has(index); } -bool CefV8ValueImpl::DeleteValue(const CefString& key) -{ +bool CefV8ValueImpl::DeleteValue(const CefString& key) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } @@ -873,16 +809,15 @@ bool CefV8ValueImpl::DeleteValue(const CefString& key) NOTREACHED() << "invalid input parameter"; return false; } - + v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return obj->Delete(GetV8String(key)); } -bool CefV8ValueImpl::DeleteValue(int index) -{ +bool CefV8ValueImpl::DeleteValue(int index) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } @@ -896,10 +831,9 @@ bool CefV8ValueImpl::DeleteValue(int index) return obj->Delete(index); } -CefRefPtr CefV8ValueImpl::GetValue(const CefString& key) -{ +CefRefPtr CefV8ValueImpl::GetValue(const CefString& key) { CEF_REQUIRE_UI_THREAD(NULL); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return NULL; } @@ -908,16 +842,15 @@ CefRefPtr CefV8ValueImpl::GetValue(const CefString& key) NOTREACHED() << "invalid input parameter"; return NULL; } - + v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return new CefV8ValueImpl(obj->Get(GetV8String(key))); } -CefRefPtr CefV8ValueImpl::GetValue(int index) -{ +CefRefPtr CefV8ValueImpl::GetValue(int index) { CEF_REQUIRE_UI_THREAD(NULL); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return NULL; } @@ -933,16 +866,15 @@ CefRefPtr CefV8ValueImpl::GetValue(int index) bool CefV8ValueImpl::SetValue(const CefString& key, CefRefPtr value, - PropertyAttribute attribute) -{ + PropertyAttribute attribute) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } - CefV8ValueImpl *impl = static_cast(value.get()); - if(impl && !key.empty()) { + CefV8ValueImpl* impl = static_cast(value.get()); + if (impl && !key.empty()) { v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return obj->Set(GetV8String(key), impl->GetHandle(), @@ -953,11 +885,10 @@ bool CefV8ValueImpl::SetValue(const CefString& key, } } -bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) -{ +bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } @@ -966,8 +897,8 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) return false; } - CefV8ValueImpl *impl = static_cast(value.get()); - if(impl) { + CefV8ValueImpl* impl = static_cast(value.get()); + if (impl) { v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); return obj->Set(index, impl->GetHandle()); @@ -977,11 +908,10 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr value) } } -bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings, - PropertyAttribute attribute) -{ +bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings, + PropertyAttribute attribute) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } @@ -1008,19 +938,18 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings, return rv; } -bool CefV8ValueImpl::GetKeys(std::vector& keys) -{ +bool CefV8ValueImpl::GetKeys(std::vector& keys) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return false; } - + v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); v8::Local arr_keys = obj->GetPropertyNames(); uint32_t len = arr_keys->Length(); - for(uint32_t i = 0; i < len; ++i) { + for (uint32_t i = 0; i < len; ++i) { v8::Local value = arr_keys->Get(v8::Integer::New(i)); CefString str; GetCefString(value->ToString(), str); @@ -1029,14 +958,13 @@ bool CefV8ValueImpl::GetKeys(std::vector& keys) return true; } -CefRefPtr CefV8ValueImpl::GetUserData() -{ +CefRefPtr CefV8ValueImpl::GetUserData() { CEF_REQUIRE_UI_THREAD(NULL); - if(!GetHandle()->IsObject()) { + if (!GetHandle()->IsObject()) { NOTREACHED() << "V8 value is not an object"; return NULL; } - + v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); @@ -1048,10 +976,9 @@ CefRefPtr CefV8ValueImpl::GetUserData() return NULL; } -int CefV8ValueImpl::GetArrayLength() -{ +int CefV8ValueImpl::GetArrayLength() { CEF_REQUIRE_UI_THREAD(0); - if(!GetHandle()->IsArray()) { + if (!GetHandle()->IsArray()) { NOTREACHED() << "V8 value is not an array"; return 0; } @@ -1062,15 +989,14 @@ int CefV8ValueImpl::GetArrayLength() return arr->Length(); } -CefString CefV8ValueImpl::GetFunctionName() -{ +CefString CefV8ValueImpl::GetFunctionName() { CefString rv; CEF_REQUIRE_UI_THREAD(rv); - if(!GetHandle()->IsFunction()) { + if (!GetHandle()->IsFunction()) { NOTREACHED() << "V8 value is not a function"; return rv; } - + v8::HandleScope handle_scope; v8::Local obj = GetHandle()->ToObject(); v8::Local func = v8::Local::Cast(obj); @@ -1078,10 +1004,9 @@ CefString CefV8ValueImpl::GetFunctionName() return rv; } -CefRefPtr CefV8ValueImpl::GetFunctionHandler() -{ +CefRefPtr CefV8ValueImpl::GetFunctionHandler() { CEF_REQUIRE_UI_THREAD(NULL); - if(!GetHandle()->IsFunction()) { + if (!GetHandle()->IsFunction()) { NOTREACHED() << "V8 value is not a function"; return NULL; } @@ -1101,11 +1026,10 @@ bool CefV8ValueImpl::ExecuteFunction(CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefRefPtr& exception, - bool rethrow_exception) -{ + bool rethrow_exception) { // An empty context value defaults to the current context. CefRefPtr context; - return ExecuteFunctionWithContext(context, object, arguments, retval, + return ExecuteFunctionWithContext(context, object, arguments, retval, exception, rethrow_exception); } @@ -1115,10 +1039,9 @@ bool CefV8ValueImpl::ExecuteFunctionWithContext( const CefV8ValueList& arguments, CefRefPtr& retval, CefRefPtr& exception, - bool rethrow_exception) -{ + bool rethrow_exception) { CEF_REQUIRE_UI_THREAD(false); - if(!GetHandle()->IsFunction()) { + if (!GetHandle()->IsFunction()) { NOTREACHED() << "V8 value is not a function"; return false; } @@ -1170,8 +1093,7 @@ bool CefV8ValueImpl::ExecuteFunctionWithContext( } // static -CefV8Accessor* CefV8ValueImpl::GetAccessor(v8::Handle object) -{ +CefV8Accessor* CefV8ValueImpl::GetAccessor(v8::Handle object) { v8::Local value = object->GetHiddenValue(v8::String::New(kCefAccessor)); if (!value.IsEmpty()) diff --git a/libcef/v8_impl.h b/libcef/v8_impl.h index b28535698..152cdfbde 100644 --- a/libcef/v8_impl.h +++ b/libcef/v8_impl.h @@ -2,11 +2,15 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _V8_IMPL_H -#define _V8_IMPL_H +#ifndef CEF_LIBCEF_V8_IMPL_H_ +#define CEF_LIBCEF_V8_IMPL_H_ +#pragma once +#include #include "include/cef_v8.h" #include "v8/include/v8.h" +#include "libcef/cef_thread.h" +#include "base/memory/ref_counted.h" class CefTrackObject; @@ -17,25 +21,21 @@ class WebFrame; // Template for V8 Handle types. This class is used to ensure that V8 objects // are only released on the UI thread. template -class CefReleaseV8HandleOnUIThread: - public base::RefCountedThreadSafe, - CefThread::DeleteOnUIThread> -{ -public: +class CefReleaseV8HandleOnUIThread + : public base::RefCountedThreadSafe, + CefThread::DeleteOnUIThread> { + public: typedef v8::Handle handleType; typedef v8::Persistent persistentType; typedef CefReleaseV8HandleOnUIThread superType; - CefReleaseV8HandleOnUIThread(handleType v) - { + explicit CefReleaseV8HandleOnUIThread(handleType v) { v8_handle_ = persistentType::New(v); } - virtual ~CefReleaseV8HandleOnUIThread() - { + virtual ~CefReleaseV8HandleOnUIThread() { } - handleType GetHandle() - { + handleType GetHandle() { return v8_handle_; } @@ -44,25 +44,22 @@ public: // Special class for a v8::Context to ensure that it is deleted from the UI // thread. -class CefV8ContextHandle : public CefReleaseV8HandleOnUIThread -{ -public: - CefV8ContextHandle(handleType context): superType(context) - { +class CefV8ContextHandle : public CefReleaseV8HandleOnUIThread { + public: + explicit CefV8ContextHandle(handleType context) + : superType(context) { } // Context handles are disposed rather than makeweak. - ~CefV8ContextHandle() - { + ~CefV8ContextHandle() { v8_handle_.Dispose(); v8_handle_.Clear(); } }; -class CefV8ContextImpl : public CefV8Context -{ -public: - CefV8ContextImpl(v8::Handle context); +class CefV8ContextImpl : public CefV8Context { + public: + explicit CefV8ContextImpl(v8::Handle context); virtual ~CefV8ContextImpl(); virtual CefRefPtr GetBrowser() OVERRIDE; @@ -75,7 +72,7 @@ public: v8::Local GetContext(); WebKit::WebFrame* GetWebFrame(); -protected: + protected: scoped_refptr v8_context_; #ifndef NDEBUG @@ -88,25 +85,23 @@ protected: // Special class for a v8::Value to ensure that it is deleted from the UI // thread. -class CefV8ValueHandle: public CefReleaseV8HandleOnUIThread -{ -public: +class CefV8ValueHandle: public CefReleaseV8HandleOnUIThread { + public: CefV8ValueHandle(handleType value, CefTrackObject* tracker) - : superType(value), tracker_(tracker) - { + : superType(value), + tracker_(tracker) { } // Destructor implementation is provided in v8_impl.cc. ~CefV8ValueHandle(); -private: + private: // For Object and Function types, we need to hold on to a reference to their // internal data or function handler objects that are reference counted. - CefTrackObject *tracker_; + CefTrackObject* tracker_; }; -class CefV8ValueImpl : public CefV8Value -{ -public: +class CefV8ValueImpl : public CefV8Value { + public: CefV8ValueImpl(v8::Handle value, CefTrackObject* tracker = NULL); virtual ~CefV8ValueImpl(); @@ -135,7 +130,7 @@ public: virtual bool SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) OVERRIDE; virtual bool SetValue(int index, CefRefPtr value) OVERRIDE; - virtual bool SetValue(const CefString& key, AccessControl settings, + virtual bool SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) OVERRIDE; virtual bool GetKeys(std::vector& keys) OVERRIDE; virtual CefRefPtr GetUserData() OVERRIDE; @@ -155,8 +150,7 @@ public: CefRefPtr& exception, bool rethrow_exception) OVERRIDE; - inline v8::Handle GetHandle() - { + inline v8::Handle GetHandle() { DCHECK(v8_value_.get()); return v8_value_->GetHandle(); } @@ -164,10 +158,10 @@ public: // Returns the accessor assigned for the specified object, if any. static CefV8Accessor* GetAccessor(v8::Handle object); -protected: + protected: scoped_refptr v8_value_; IMPLEMENT_REFCOUNTING(CefV8ValueImpl); }; -#endif //_V8_IMPL_H +#endif // CEF_LIBCEF_V8_IMPL_H_ diff --git a/libcef/web_drag_source_mac.h b/libcef/web_drag_source_mac.h index 3db96b990..df6062e59 100644 --- a/libcef/web_drag_source_mac.h +++ b/libcef/web_drag_source_mac.h @@ -3,6 +3,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef CEF_LIBCEF_WEB_DRAG_SOURCE_MAC_H_ +#define CEF_LIBCEF_WEB_DRAG_SOURCE_MAC_H_ +#pragma once + #import #include "base/file_path.h" @@ -80,3 +84,5 @@ struct WebDropData; - (NSString*)dragPromisedFileTo:(NSString*)path; @end + +#endif // CEF_LIBCEF_WEB_DRAG_SOURCE_MAC_H_ diff --git a/libcef/web_drag_source_mac.mm b/libcef/web_drag_source_mac.mm index 4a608bb60..1cf0a0b21 100644 --- a/libcef/web_drag_source_mac.mm +++ b/libcef/web_drag_source_mac.mm @@ -3,15 +3,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_impl.h" -#include "browser_webkit_glue.h" -#import "browser_webview_mac.h" -#include "drag_download_util.h" -#include "download_util.h" -#import "web_drag_source_mac.h" - #include +#include "libcef/browser_impl.h" +#include "libcef/browser_webkit_glue.h" +#import "libcef/browser_webview_mac.h" +#include "libcef/drag_download_util.h" +#include "libcef/download_util.h" +#import "libcef/web_drag_source_mac.h" + #include "base/file_path.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" diff --git a/libcef/web_drag_source_win.cc b/libcef/web_drag_source_win.cc index 5311f4029..660902264 100644 --- a/libcef/web_drag_source_win.cc +++ b/libcef/web_drag_source_win.cc @@ -3,9 +3,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "web_drag_source_win.h" -#include "web_drag_utils_win.h" -#include "cef_thread.h" +#include "libcef/web_drag_source_win.h" +#include "libcef/web_drag_utils_win.h" +#include "libcef/cef_thread.h" #include "base/task.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" diff --git a/libcef/web_drag_source_win.h b/libcef/web_drag_source_win.h index 030a62335..283735acb 100644 --- a/libcef/web_drag_source_win.h +++ b/libcef/web_drag_source_win.h @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _WEB_DRAG_SOURCE_WIN_H -#define _WEB_DRAG_SOURCE_WIN_H +#ifndef CEF_LIBCEF_WEB_DRAG_SOURCE_WIN_H_ +#define CEF_LIBCEF_WEB_DRAG_SOURCE_WIN_H_ #pragma once #include "base/basictypes.h" @@ -23,7 +23,7 @@ class WebView; class WebDragSource : public ui::DragSource { public: // Create a new DragSource for a given HWND and WebView. - WebDragSource(gfx::NativeWindow source_wnd, WebKit::WebView* view); + WebDragSource(gfx::NativeWindow source_wnd, WebKit::WebView* view); virtual ~WebDragSource(); void set_effect(DWORD effect) { effect_ = effect; } @@ -55,4 +55,4 @@ class WebDragSource : public ui::DragSource { DISALLOW_COPY_AND_ASSIGN(WebDragSource); }; -#endif // _WEB_DRAG_SOURCE_WIN_H +#endif // CEF_LIBCEF_WEB_DRAG_SOURCE_WIN_H_ diff --git a/libcef/web_drag_utils_mac.h b/libcef/web_drag_utils_mac.h index 2e7bbfea4..3e9daaa80 100644 --- a/libcef/web_drag_utils_mac.h +++ b/libcef/web_drag_utils_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _WEB_DRAG_UTILS_MAC -#define _WEB_DRAG_UTILS_MAC +#ifndef CEF_LIBCEF_WEB_DRAG_UTILS_MAC_H_ +#define CEF_LIBCEF_WEB_DRAG_UTILS_MAC_H_ #pragma once #import @@ -34,4 +34,4 @@ BOOL IsUnsupportedDropData(id info); } // namespace drag_util -#endif // _WEB_DRAG_UTILS_MAC +#endif // CEF_LIBCEF_WEB_DRAG_UTILS_MAC_H_ diff --git a/libcef/web_drag_utils_mac.mm b/libcef/web_drag_utils_mac.mm index 4dbad3140..9570df418 100644 --- a/libcef/web_drag_utils_mac.mm +++ b/libcef/web_drag_utils_mac.mm @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_webkit_glue.h" -#import "web_drag_utils_mac.h" +#include "libcef/browser_webkit_glue.h" +#import "libcef/web_drag_utils_mac.h" #include "base/basictypes.h" #include "base/logging.h" diff --git a/libcef/web_drag_utils_win.cc b/libcef/web_drag_utils_win.cc index c01053949..2812b7ef0 100644 --- a/libcef/web_drag_utils_win.cc +++ b/libcef/web_drag_utils_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "web_drag_utils_win.h" +#include "libcef/web_drag_utils_win.h" #include #include "base/logging.h" diff --git a/libcef/web_drag_utils_win.h b/libcef/web_drag_utils_win.h index 690bd5cda..8fd3e307f 100644 --- a/libcef/web_drag_utils_win.h +++ b/libcef/web_drag_utils_win.h @@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _WEB_DRAG_UTILS_WIN_H -#define _WEB_DRAG_UTILS_WIN_H +#ifndef CEF_LIBCEF_WEB_DRAG_UTILS_WIN_H_ +#define CEF_LIBCEF_WEB_DRAG_UTILS_WIN_H_ #pragma once -#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" - #include +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" namespace web_drag_utils_win { @@ -20,4 +19,4 @@ DWORD WebDragOpMaskToWinDragOpMask(WebKit::WebDragOperationsMask ops); } // namespace web_drag_utils_win -#endif // _WEB_DRAG_UTILS_WIN_H +#endif // CEF_LIBCEF_WEB_DRAG_UTILS_WIN_H_ diff --git a/libcef/web_drop_target_mac.h b/libcef/web_drop_target_mac.h index b2b562dc7..acfe102e1 100644 --- a/libcef/web_drop_target_mac.h +++ b/libcef/web_drop_target_mac.h @@ -3,6 +3,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef CEF_LIBCEF_WEB_DROP_TARGET_MAC_H_ +#define CEF_LIBCEF_WEB_DROP_TARGET_MAC_H_ +#pragma once + #import #include "base/string16.h" @@ -61,3 +65,5 @@ class WebViewHost; - (NSPoint)flipWindowPointToScreen:(const NSPoint&)windowPoint view:(NSView*)view; @end + +#endif // CEF_LIBCEF_WEB_DROP_TARGET_MAC_H_ diff --git a/libcef/web_drop_target_mac.mm b/libcef/web_drop_target_mac.mm index ef54ed4c0..47a4354eb 100644 --- a/libcef/web_drop_target_mac.mm +++ b/libcef/web_drop_target_mac.mm @@ -3,12 +3,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_impl.h" -#import "browser_webview_mac.h" -#include "cef_context.h" -#include "drag_data_impl.h" -#import "web_drop_target_mac.h" -#import "web_drag_utils_mac.h" +#include "libcef/browser_impl.h" +#import "libcef/browser_webview_mac.h" +#include "libcef/cef_context.h" +#include "libcef/drag_data_impl.h" +#import "libcef/web_drop_target_mac.h" +#import "libcef/web_drag_utils_mac.h" #include "base/logging.h" #include "base/sys_string_conversions.h" diff --git a/libcef/web_drop_target_win.cc b/libcef/web_drop_target_win.cc index 8cf8a6a48..0cf55b032 100644 --- a/libcef/web_drop_target_win.cc +++ b/libcef/web_drop_target_win.cc @@ -3,15 +3,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser_impl.h" -#include "cef_context.h" -#include "drag_data_impl.h" -#include "web_drag_utils_win.h" -#include "web_drop_target_win.h" +#include "libcef/web_drop_target_win.h" #include #include +#include "libcef/browser_impl.h" +#include "libcef/cef_context.h" +#include "libcef/drag_data_impl.h" +#include "libcef/web_drag_utils_win.h" + #include "googleurl/src/gurl.h" #include "net/base/net_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.h" diff --git a/libcef/web_drop_target_win.h b/libcef/web_drop_target_win.h index 152653f75..5759c9bda 100644 --- a/libcef/web_drop_target_win.h +++ b/libcef/web_drop_target_win.h @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _WEB_DROP_TARGET_WIN_H -#define _WEB_DROP_TARGET_WIN_H +#ifndef CEF_LIBCEF_WEB_DROP_TARGET_WIN_H_ +#define CEF_LIBCEF_WEB_DROP_TARGET_WIN_H_ #pragma once #include "base/memory/scoped_ptr.h" @@ -21,7 +21,7 @@ class WebDropTarget : public ui::DropTarget { public: // Create a new WebDropTarget associating it with the given HWND and // WebView. - WebDropTarget(CefBrowserImpl* browser); + explicit WebDropTarget(CefBrowserImpl* browser); virtual ~WebDropTarget(); void set_drag_cursor(WebKit::WebDragOperation op) { @@ -66,4 +66,4 @@ class WebDropTarget : public ui::DropTarget { DISALLOW_COPY_AND_ASSIGN(WebDropTarget); }; -#endif // _WEB_DROP_TARGET_WIN_H +#endif // CEF_LIBCEF_WEB_DROP_TARGET_WIN_H_ diff --git a/libcef/web_urlrequest_impl.cc b/libcef/web_urlrequest_impl.cc index ede5c7013..70f2d03e8 100644 --- a/libcef/web_urlrequest_impl.cc +++ b/libcef/web_urlrequest_impl.cc @@ -2,11 +2,11 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "web_urlrequest_impl.h" -#include "browser_webkit_init.h" -#include "cef_thread.h" -#include "request_impl.h" -#include "response_impl.h" +#include "libcef/web_urlrequest_impl.h" +#include "libcef/browser_webkit_init.h" +#include "libcef/cef_thread.h" +#include "libcef/request_impl.h" +#include "libcef/response_impl.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -29,17 +29,14 @@ class CefWebURLLoaderClientImpl; // Manages the lifespan of WebKit objects. Methods of this class will only be // called on the UI thread. -class CefWebURLRequestImpl::Context : - public base::RefCountedThreadSafe -{ -public: - Context(CefRefPtr client) - : client_(client) - { +class CefWebURLRequestImpl::Context + : public base::RefCountedThreadSafe { + public: + explicit Context(CefRefPtr client) + : client_(client) { } - virtual ~Context() - { + virtual ~Context() { } void initialize(CefRefPtr request); @@ -48,10 +45,10 @@ public: CefRefPtr client() { return client_; } -protected: - CefRefPtr client_; - scoped_ptr url_loader_; - scoped_ptr url_client_; + protected: + CefRefPtr client_; + scoped_ptr url_loader_; + scoped_ptr url_client_; }; @@ -59,15 +56,12 @@ namespace { // Implements the WebURLLoaderClient interface. Methods of this class will only // be called on the UI thread. -class CefWebURLLoaderClientImpl : public WebKit::WebURLLoaderClient -{ -public: - CefWebURLLoaderClientImpl(CefWebURLRequestImpl::Context* context) - : context_(context) - { +class CefWebURLLoaderClientImpl : public WebKit::WebURLLoaderClient { + public: + explicit CefWebURLLoaderClientImpl(CefWebURLRequestImpl::Context* context) + : context_(context) { } - virtual ~CefWebURLLoaderClientImpl() - { + virtual ~CefWebURLLoaderClientImpl() { } // ===================================================================== @@ -77,11 +71,10 @@ public: // Called when following a redirect. |newRequest| contains the request // generated by the redirect. The client may modify |newRequest|. virtual void willSendRequest(WebKit::WebURLLoader*, - WebKit::WebURLRequest& newRequest, - const WebKit::WebURLResponse& redirectResponse) - { + WebKit::WebURLRequest& newRequest, + const WebKit::WebURLResponse& redirectResponse) { REQUIRE_UIT(); - if(!context_) + if (!context_) return; CefRefPtr client = context_->client(); @@ -101,11 +94,12 @@ public: // Called to report upload progress. The bytes reported correspond to // the HTTP message body. - virtual void didSendData(WebKit::WebURLLoader*, unsigned long long bytesSent, - unsigned long long totalBytesToBeSent) - { + virtual void didSendData( + WebKit::WebURLLoader*, + unsigned long long bytesSent, // NOLINT(runtime/int) + unsigned long long totalBytesToBeSent) { // NOLINT(runtime/int) REQUIRE_UIT(); - if(!context_) + if (!context_) return; CefRefPtr client = context_->client(); @@ -118,10 +112,9 @@ public: // Called when response headers are received. virtual void didReceiveResponse(WebKit::WebURLLoader*, - const WebKit::WebURLResponse& response) - { + const WebKit::WebURLResponse& response) { REQUIRE_UIT(); - if(!context_) + if (!context_) return; CefRefPtr client = context_->client(); @@ -137,17 +130,15 @@ public: // Called when a chunk of response data is downloaded. This is only called // if WebURLRequest's downloadToFile flag was set to true. - virtual void didDownloadData(WebKit::WebURLLoader*, int dataLength) - { + virtual void didDownloadData(WebKit::WebURLLoader*, int dataLength) { NOTREACHED(); } // Called when a chunk of response data is received. virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, - int lengthReceived) - { + int lengthReceived) { REQUIRE_UIT(); - if(!context_) + if (!context_) return; CefRefPtr client = context_->client(); @@ -160,19 +151,17 @@ public: } } - // Called when a chunk of renderer-generated metadata is received from + // Called when a chunk of renderer-generated metadata is received from // the cache. - virtual void didReceiveCachedMetadata(WebKit::WebURLLoader*, const char* data, - int dataLength) - { + virtual void didReceiveCachedMetadata(WebKit::WebURLLoader*, const char* data, + int dataLength) { NOTREACHED(); } // Called when the load completes successfully. - virtual void didFinishLoading(WebKit::WebURLLoader*, double finishTime) - { + virtual void didFinishLoading(WebKit::WebURLLoader*, double finishTime) { REQUIRE_UIT(); - if(!context_) + if (!context_) return; CefRefPtr client = context_->client(); @@ -183,10 +172,10 @@ public: } // Called when the load completes with an error. - virtual void didFail(WebKit::WebURLLoader*, const WebKit::WebURLError& error) - { + virtual void didFail(WebKit::WebURLLoader*, + const WebKit::WebURLError& error) { REQUIRE_UIT(); - if(!context_) + if (!context_) return; CefRefPtr client = context_->client(); @@ -194,32 +183,30 @@ public: client->DoStateChange(WUR_STATE_ERROR); CefRefPtr handler = client->GetHandler(); if (handler.get()) { - handler->OnError(client.get(), + handler->OnError(client.get(), static_cast(error.reason)); } } - + complete(); } - void complete() - { + void complete() { context_->destroy(); context_ = NULL; } -protected: - scoped_refptr context_; + protected: + scoped_refptr context_; }; -} // namespace +} // namespace // CefWebURLManager void CefWebURLRequestImpl::Context::initialize( - CefRefPtr request) -{ + CefRefPtr request) { REQUIRE_UIT(); url_loader_.reset( @@ -232,14 +219,12 @@ void CefWebURLRequestImpl::Context::initialize( url_loader_->loadAsynchronously(urlRequest, url_client_.get()); } -void CefWebURLRequestImpl::Context::destroy() -{ +void CefWebURLRequestImpl::Context::destroy() { REQUIRE_UIT(); client_ = NULL; } -void CefWebURLRequestImpl::Context::cancel() -{ +void CefWebURLRequestImpl::Context::cancel() { REQUIRE_UIT(); url_loader_->cancel(); url_client_->complete(); @@ -251,8 +236,7 @@ void CefWebURLRequestImpl::Context::cancel() // static CefRefPtr CefWebURLRequest::CreateWebURLRequest( - CefRefPtr request, CefRefPtr client) -{ + CefRefPtr request, CefRefPtr client) { CefRefPtr requester = new CefWebURLRequestImpl(client); // Send the request from the UI thread. @@ -269,28 +253,23 @@ CefWebURLRequest::CreateWebURLRequest( CefWebURLRequestImpl::CefWebURLRequestImpl( CefRefPtr handler) : handler_(handler), - state_(WUR_STATE_UNSENT) -{ + state_(WUR_STATE_UNSENT) { } -CefWebURLRequestImpl::~CefWebURLRequestImpl() -{ +CefWebURLRequestImpl::~CefWebURLRequestImpl() { } -CefWebURLRequestImpl::RequestState CefWebURLRequestImpl::GetState() -{ +CefWebURLRequestImpl::RequestState CefWebURLRequestImpl::GetState() { AutoLock lock_scope(this); return state_; } -void CefWebURLRequestImpl::Cancel() -{ +void CefWebURLRequestImpl::Cancel() { CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this, &CefWebURLRequestImpl::DoCancel)); } -void CefWebURLRequestImpl::DoSend(CefRefPtr request) -{ +void CefWebURLRequestImpl::DoSend(CefRefPtr request) { REQUIRE_UIT(); DCHECK(state_ == WUR_STATE_UNSENT); @@ -300,8 +279,7 @@ void CefWebURLRequestImpl::DoSend(CefRefPtr request) DoStateChange(WUR_STATE_STARTED); } -void CefWebURLRequestImpl::DoCancel() -{ +void CefWebURLRequestImpl::DoCancel() { REQUIRE_UIT(); if (state_ < WUR_STATE_DONE) { @@ -310,8 +288,7 @@ void CefWebURLRequestImpl::DoCancel() } } -void CefWebURLRequestImpl::DoStateChange(RequestState newState) -{ +void CefWebURLRequestImpl::DoStateChange(RequestState newState) { REQUIRE_UIT(); if (state_ == newState) diff --git a/libcef/web_urlrequest_impl.h b/libcef/web_urlrequest_impl.h index 747340d79..774ffc66a 100644 --- a/libcef/web_urlrequest_impl.h +++ b/libcef/web_urlrequest_impl.h @@ -2,15 +2,15 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _WEB_URL_REQUEST_CLIENT_IMPL_H -#define _WEB_URL_REQUEST_CLIENT_IMPL_H +#ifndef CEF_LIBCEF_WEB_URLREQUEST_IMPL_H_ +#define CEF_LIBCEF_WEB_URLREQUEST_IMPL_H_ +#pragma once #include "include/cef_web_urlrequest.h" #include "base/memory/ref_counted.h" -class CefWebURLRequestImpl : public CefWebURLRequest -{ -public: +class CefWebURLRequestImpl : public CefWebURLRequest { + public: class Context; explicit CefWebURLRequestImpl( @@ -30,7 +30,7 @@ public: static bool ImplementsThreadSafeReferenceCounting() { return true; } -protected: + protected: CefRefPtr handler_; // The below parameters are only modified on the UI thread. @@ -41,4 +41,4 @@ protected: IMPLEMENT_LOCKING(CefWebURLRequestImpl); }; -#endif // _WEB_URL_REQUEST_CLIENT_IMPL_H +#endif // CEF_LIBCEF_WEB_URLREQUEST_IMPL_H_ diff --git a/libcef/webview_host.cc b/libcef/webview_host.cc index d54f14d30..a448ed907 100644 --- a/libcef/webview_host.cc +++ b/libcef/webview_host.cc @@ -2,15 +2,13 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "webview_host.h" +#include "libcef/webview_host.h" WebViewHost::WebViewHost(BrowserWebViewDelegate* delegate) - : delegate_(delegate) -{ + : delegate_(delegate) { } #if !defined(OS_MACOSX) -WebViewHost::~WebViewHost() -{ +WebViewHost::~WebViewHost() { } #endif diff --git a/libcef/webview_host.h b/libcef/webview_host.h index d545c4a7b..61069c70b 100644 --- a/libcef/webview_host.h +++ b/libcef/webview_host.h @@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _WEBVIEW_HOST_H -#define _WEBVIEW_HOST_H +#ifndef CEF_LIBCEF_WEBVIEW_HOST_H_ +#define CEF_LIBCEF_WEBVIEW_HOST_H_ +#pragma once +#include "libcef/webwidget_host.h" #include "base/basictypes.h" #include "ui/gfx/native_widget_types.h" -#include "webwidget_host.h" #if defined(TOOLKIT_USES_GTK) #include "webkit/plugins/npapi/gtk_plugin_container_manager.h" @@ -52,13 +53,13 @@ class WebViewHost : public WebWidgetHost { virtual void KeyEvent(GdkEventKey* event); #elif defined(OS_MACOSX) void SetIsActive(bool active); - virtual void MouseEvent(NSEvent *); - virtual void KeyEvent(NSEvent *); + virtual void MouseEvent(NSEvent* event); + virtual void KeyEvent(NSEvent* event); virtual void SetFocus(bool enable); #endif protected: - WebViewHost(BrowserWebViewDelegate* delegate); + explicit WebViewHost(BrowserWebViewDelegate* delegate); #if defined(OS_WIN) virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam); @@ -75,4 +76,4 @@ class WebViewHost : public WebWidgetHost { BrowserWebViewDelegate* delegate_; }; -#endif // _WEBVIEW_HOST_H +#endif // CEF_LIBCEF_WEBVIEW_HOST_H_ diff --git a/libcef/webview_host_gtk.cc b/libcef/webview_host_gtk.cc index e06988c82..f7d12c82d 100644 --- a/libcef/webview_host_gtk.cc +++ b/libcef/webview_host_gtk.cc @@ -4,8 +4,8 @@ #include -#include "webview_host.h" -#include "browser_webview_delegate.h" +#include "libcef/webview_host.h" +#include "libcef/browser_webview_delegate.h" #include "base/logging.h" #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h" diff --git a/libcef/webview_host_mac.mm b/libcef/webview_host_mac.mm index ee452fe31..b51dfff99 100644 --- a/libcef/webview_host_mac.mm +++ b/libcef/webview_host_mac.mm @@ -4,10 +4,10 @@ #import -#include "webview_host.h" -#include "browser_webview_delegate.h" -#include "browser_webview_mac.h" -#include "cef_context.h" +#include "libcef/webview_host.h" +#include "libcef/browser_webview_delegate.h" +#include "libcef/browser_webview_mac.h" +#include "libcef/cef_context.h" #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebInputEventFactory.h" diff --git a/libcef/webview_host_win.cc b/libcef/webview_host_win.cc index 193230cfe..0daf8c3c1 100644 --- a/libcef/webview_host_win.cc +++ b/libcef/webview_host_win.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webview_host.h" -#include "browser_webview_delegate.h" -#include "cef_context.h" +#include "libcef/webview_host.h" +#include "libcef/browser_webview_delegate.h" +#include "libcef/cef_context.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" diff --git a/libcef/webwidget_host.cc b/libcef/webwidget_host.cc index 33f345b65..411561330 100644 --- a/libcef/webwidget_host.cc +++ b/libcef/webwidget_host.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webwidget_host.h" -#include "cef_thread.h" +#include "libcef/webwidget_host.h" +#include "libcef/cef_thread.h" #include "base/bind.h" #include "base/message_loop.h" @@ -46,7 +46,7 @@ void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { paint_rgn_.op(rect.x(), rect.y(), rect.right(), rect.bottom(), SkRegion::kUnion_Op); #else - // TODO: Update all ports to use regions instead of rectangles. + // TODO(cef): Update all ports to use regions instead of rectangles. paint_rect_ = paint_rect_.Union(rect); #endif } @@ -68,21 +68,18 @@ void WebWidgetHost::GetSize(int& width, int& height) { height = size.height; } -void WebWidgetHost::AddWindowedPlugin(gfx::PluginWindowHandle handle) -{ +void WebWidgetHost::AddWindowedPlugin(gfx::PluginWindowHandle handle) { WebPluginGeometry geometry; plugin_map_.insert(std::make_pair(handle, geometry)); } -void WebWidgetHost::RemoveWindowedPlugin(gfx::PluginWindowHandle handle) -{ +void WebWidgetHost::RemoveWindowedPlugin(gfx::PluginWindowHandle handle) { PluginMap::iterator it = plugin_map_.find(handle); DCHECK(it != plugin_map_.end()); plugin_map_.erase(it); } -void WebWidgetHost::MoveWindowedPlugin(const WebPluginGeometry& move) -{ +void WebWidgetHost::MoveWindowedPlugin(const WebPluginGeometry& move) { PluginMap::iterator it = plugin_map_.find(move.window); DCHECK(it != plugin_map_.end()); @@ -96,11 +93,10 @@ void WebWidgetHost::MoveWindowedPlugin(const WebPluginGeometry& move) it->second.visible = move.visible; } -gfx::PluginWindowHandle WebWidgetHost::GetWindowedPluginAt(int x, int y) -{ +gfx::PluginWindowHandle WebWidgetHost::GetWindowedPluginAt(int x, int y) { if (!plugin_map_.empty()) { PluginMap::const_iterator it = plugin_map_.begin(); - for(; it != plugin_map_.end(); ++it) { + for (; it != plugin_map_.end(); ++it) { if (it->second.visible && it->second.window_rect.Contains(x, y)) return it->second.window; } diff --git a/libcef/webwidget_host.h b/libcef/webwidget_host.h index 4b350a3b0..b0a8c4f5a 100644 --- a/libcef/webwidget_host.h +++ b/libcef/webwidget_host.h @@ -2,12 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef _WEBWIDGET_HOST_H -#define _WEBWIDGET_HOST_H +#ifndef CEF_LIBCEF_WEBWIDGET_HOST_H_ +#define CEF_LIBCEF_WEBWIDGET_HOST_H_ +#pragma once + +#include +#include #include "include/internal/cef_string.h" #include "include/internal/cef_types.h" #include "include/internal/cef_types_wrappers.h" + #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -21,14 +26,13 @@ #include "ui/gfx/native_widget_types.h" #include "ui/gfx/rect.h" #include "webkit/plugins/npapi/webplugin.h" -#include #if defined(OS_WIN) #include "ui/base/win/ime_input.h" #endif #if defined(TOOLKIT_USES_GTK) -#include +#include // NOLINT(build/include_order) #endif namespace gfx { @@ -56,6 +60,7 @@ class WebWidgetHost { public: class PaintDelegate { public: + virtual ~PaintDelegate() {} virtual void Paint(bool popup, const std::vector& dirtyRects, const void* buffer) =0; }; @@ -176,12 +181,14 @@ class WebWidgetHost { // These need to be called from a non-subclass, so they need to be public. public: void Resize(const gfx::Rect& rect); - virtual void MouseEvent(NSEvent *); - void WheelEvent(NSEvent *); - virtual void KeyEvent(NSEvent *); + virtual void MouseEvent(NSEvent* event); + void WheelEvent(NSEvent* event); + virtual void KeyEvent(NSEvent* event); virtual void SetFocus(bool enable); + protected: #elif defined(TOOLKIT_USES_GTK) + public: // --------------------------------------------------------------------------- // This is needed on Linux because the GtkWidget creation is the same between @@ -250,7 +257,7 @@ class WebWidgetHost { // The map of windowed plugins that need to be drawn when window rendering is // disabled. - typedef std::map + typedef std::map PluginMap; PluginMap plugin_map_; @@ -293,4 +300,4 @@ class WebWidgetHost { base::WeakPtrFactory weak_factory_; }; -#endif // _WEBWIDGET_HOST_H +#endif // CEF_LIBCEF_WEBWIDGET_HOST_H_ diff --git a/libcef/webwidget_host_gtk.cc b/libcef/webwidget_host_gtk.cc index 1d13b7c07..da230be21 100644 --- a/libcef/webwidget_host_gtk.cc +++ b/libcef/webwidget_host_gtk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webwidget_host.h" +#include "libcef/webwidget_host.h" #include #include @@ -379,7 +379,7 @@ void WebWidgetHost::Paint() { total_paint = total_paint.Union(rect); } } - //DCHECK(paint_rect_.IsEmpty()); + // DCHECK(paint_rect_.IsEmpty()); // Invalidate the paint region on the widget's underlying gdk window. Note // that gdk_window_invalidate_* will generate extra expose events, which @@ -410,19 +410,16 @@ void WebWidgetHost::Paint() { has_invalidate_task_ = false; } -void WebWidgetHost::SetTooltipText(const CefString& tooltip_text) -{ +void WebWidgetHost::SetTooltipText(const CefString& tooltip_text) { // TODO(port): Implement this method as part of tooltip support. } -void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) -{ +void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -bool WebWidgetHost::GetImage(int width, int height, void* rgba_buffer) -{ +bool WebWidgetHost::GetImage(int width, int height, void* rgba_buffer) { if (!canvas_.get()) return false; @@ -444,56 +441,47 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) { } void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers, - bool sysChar, bool imeChar) -{ + bool sysChar, bool imeChar) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } void WebWidgetHost::SendMouseClickEvent(int x, int y, cef_mouse_button_type_t type, - bool mouseUp, int clickCount) -{ + bool mouseUp, int clickCount) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) -{ +void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) -{ +void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendFocusEvent(bool setFocus) -{ +void WebWidgetHost::SendFocusEvent(bool setFocus) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendCaptureLostEvent() -{ +void WebWidgetHost::SendCaptureLostEvent() { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::EnsureTooltip() -{ +void WebWidgetHost::EnsureTooltip() { // TODO(port): Implement this method as part of tooltip support. } -void WebWidgetHost::ResetTooltip() -{ +void WebWidgetHost::ResetTooltip() { // TODO(port): Implement this method as part of tooltip support. } -void WebWidgetHost::KeyEvent(GdkEventKey* event) -{ +void WebWidgetHost::KeyEvent(GdkEventKey* event) { WebKeyboardEvent keyboard_event(WebInputEventFactory::keyboardEvent(event)); last_key_event_ = keyboard_event; webwidget()->handleInputEvent(keyboard_event); diff --git a/libcef/webwidget_host_mac.mm b/libcef/webwidget_host_mac.mm index 90ea726b2..9f9f605d0 100644 --- a/libcef/webwidget_host_mac.mm +++ b/libcef/webwidget_host_mac.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #import -#import "webwidget_host.h" +#import "libcef/webwidget_host.h" #import "base/logging.h" #import "skia/ext/platform_canvas.h" #import "third_party/WebKit/Source/WebKit/chromium/public/mac/WebInputEventFactory.h" @@ -30,17 +30,15 @@ using WebKit::WebWidgetClient; namespace { -inline SkIRect convertToSkiaRect(const gfx::Rect& r) -{ +inline SkIRect convertToSkiaRect(const gfx::Rect& r) { return SkIRect::MakeLTRB(r.x(), r.y(), r.right(), r.bottom()); } -inline gfx::Rect convertFromSkiaRect(const SkIRect& r) -{ +inline gfx::Rect convertFromSkiaRect(const SkIRect& r) { return gfx::Rect(r.x(), r.y(), r.width(), r.height()); } -} // namespace +} // namespace /*static*/ WebWidgetHost* WebWidgetHost::Create(NSView* parent_view, @@ -238,19 +236,16 @@ void WebWidgetHost::Invalidate() { [view_ setNeedsDisplay:YES]; } -void WebWidgetHost::SetTooltipText(const CefString& tooltip_text) -{ +void WebWidgetHost::SetTooltipText(const CefString& tooltip_text) { // TODO(port): Implement this method as part of tooltip support. } -void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) -{ +void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -bool WebWidgetHost::GetImage(int width, int height, void* rgba_buffer) -{ +bool WebWidgetHost::GetImage(int width, int height, void* rgba_buffer) { if (!canvas_.get()) return false; @@ -339,50 +334,42 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) { } void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers, - bool sysChar, bool imeChar) -{ + bool sysChar, bool imeChar) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } void WebWidgetHost::SendMouseClickEvent(int x, int y, cef_mouse_button_type_t type, - bool mouseUp, int clickCount) -{ + bool mouseUp, int clickCount) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) -{ +void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) -{ +void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendFocusEvent(bool setFocus) -{ +void WebWidgetHost::SendFocusEvent(bool setFocus) { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::SendCaptureLostEvent() -{ +void WebWidgetHost::SendCaptureLostEvent() { // TODO(port): Implement this method as part of off-screen rendering support. NOTIMPLEMENTED(); } -void WebWidgetHost::EnsureTooltip() -{ +void WebWidgetHost::EnsureTooltip() { // TODO(port): Implement this method as part of tooltip support. } -void WebWidgetHost::ResetTooltip() -{ +void WebWidgetHost::ResetTooltip() { // TODO(port): Implement this method as part of tooltip support. } diff --git a/libcef/webwidget_host_win.cc b/libcef/webwidget_host_win.cc index 06b144838..87b878da4 100644 --- a/libcef/webwidget_host_win.cc +++ b/libcef/webwidget_host_win.cc @@ -3,8 +3,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webwidget_host.h" -#include "cef_thread.h" +#include +#include + +#include "libcef/webwidget_host.h" +#include "libcef/cef_thread.h" #include "base/bind.h" #include "base/logging.h" @@ -26,8 +29,6 @@ #include "ui/gfx/gdi_util.h" #include "ui/gfx/rect.h" -#include - using webkit::npapi::WebPluginGeometry; using WebKit::WebInputEvent; using WebKit::WebInputEventFactory; @@ -51,8 +52,7 @@ struct MessageInfo { LPARAM lParam; }; -BOOL CALLBACK SendMessageFunc(HWND hwnd, LPARAM lParam) -{ +BOOL CALLBACK SendMessageFunc(HWND hwnd, LPARAM lParam) { MessageInfo* info = reinterpret_cast(lParam); SendMessage(hwnd, info->message, info->wParam, info->lParam); return TRUE; @@ -61,18 +61,16 @@ BOOL CALLBACK SendMessageFunc(HWND hwnd, LPARAM lParam) // Plugins are hosted in a Chromium-created parent window so it's necessary to // send messages directly to the child window. void SendMessageToPlugin(HWND hwnd, UINT message, WPARAM wParam, - LPARAM lParam) -{ + LPARAM lParam) { MessageInfo info = {message, wParam, lParam}; EnumChildWindows(hwnd, SendMessageFunc, reinterpret_cast(&info)); } -inline SkIRect convertToSkiaRect(const gfx::Rect& r) -{ +inline SkIRect convertToSkiaRect(const gfx::Rect& r) { return SkIRect::MakeLTRB(r.x(), r.y(), r.right(), r.bottom()); } -} // namespace +} // namespace /*static*/ WebWidgetHost* WebWidgetHost::Create(HWND parent_view, @@ -254,7 +252,7 @@ LRESULT CALLBACK WebWidgetHost::WndProc(HWND hwnd, UINT message, WPARAM wparam, break; case WM_NOTIFY: - host->OnNotify(0, (NMHDR*)lparam); + host->OnNotify(0, reinterpret_cast(lparam)); break; case WM_GETDLGCODE: @@ -262,7 +260,7 @@ LRESULT CALLBACK WebWidgetHost::WndProc(HWND hwnd, UINT message, WPARAM wparam, } } - return DefWindowProc(hwnd, message, wparam, lparam);; + return DefWindowProc(hwnd, message, wparam, lparam); } void WebWidgetHost::DidInvalidateRect(const gfx::Rect& damaged_rect) { @@ -303,7 +301,7 @@ void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) { { skia::ScopedPlatformPaint scoped_platform_paint(canvas_.get()); HDC hdc = scoped_platform_paint.GetPlatformSurface(); - RECT clip_rect_win32 = clip_rect.ToRECT(), uncovered_rect = {0,0,0,0}; + RECT clip_rect_win32 = clip_rect.ToRECT(), uncovered_rect = {0, 0, 0, 0}; ScrollDC(hdc, dx, dy, NULL, &clip_rect_win32, NULL, &uncovered_rect); UpdatePaintRect(gfx::Rect(uncovered_rect)); @@ -401,8 +399,8 @@ void WebWidgetHost::Paint() { canvas_h_ = client_rect.height() + kCanvasGrowSize; canvas_.reset(new skia::PlatformCanvas(canvas_w_, canvas_h_, true)); } - } else if(!canvas_.get() || canvas_w_ != client_rect.width() || - canvas_h_ != client_rect.height()) { + } else if (!canvas_.get() || canvas_w_ != client_rect.width() || + canvas_h_ != client_rect.height()) { paint_rgn_.setRect(convertToSkiaRect(client_rect)); // The canvas must be the exact size of the client area. @@ -446,10 +444,10 @@ void WebWidgetHost::Paint() { if (!view_ && plugin_map_.size() > 0) { typedef std::list PluginList; PluginList visible_plugins; - + // Identify the visible plugins. PluginMap::const_iterator it = plugin_map_.begin(); - for(; it != plugin_map_.end(); ++it) { + for (; it != plugin_map_.end(); ++it) { if (it->second.visible && client_rect.Intersects(it->second.window_rect)) visible_plugins.push_back(&it->second); } @@ -462,10 +460,10 @@ void WebWidgetHost::Paint() { // Paint the plugin windows. PluginList::const_iterator it = visible_plugins.begin(); - for(; it != visible_plugins.end(); ++it) { + for (; it != visible_plugins.end(); ++it) { const WebPluginGeometry* geom = *(it); - - oldRGN = CreateRectRgn(0,0,1,1); + + oldRGN = CreateRectRgn(0, 0, 1, 1); GetClipRgn(drawDC, oldRGN); // Only paint inside the clip region. @@ -484,7 +482,7 @@ void WebWidgetHost::Paint() { SendMessageToPlugin(geom->window, WM_PRINT, reinterpret_cast(drawDC), PRF_OWNED | PRF_ERASEBKGND | PRF_CLIENT | PRF_NONCLIENT); - + SetViewportOrgEx(drawDC, oldViewport.x, oldViewport.y, NULL); SelectClipRgn(drawDC, oldRGN); @@ -533,11 +531,10 @@ void WebWidgetHost::Paint() { has_invalidate_task_ = false; } -void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) -{ +void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) { if (rect.IsEmpty()) return; - + if (view_) { // Let the window handle painting. RECT r = rect.ToRECT(); @@ -553,8 +550,7 @@ void WebWidgetHost::InvalidateRect(const gfx::Rect& rect) } } -bool WebWidgetHost::GetImage(int width, int height, void* buffer) -{ +bool WebWidgetHost::GetImage(int width, int height, void* buffer) { const SkBitmap& bitmap = canvas_->getDevice()->accessBitmap(false); DCHECK(bitmap.config() == SkBitmap::kARGB_8888_Config); @@ -602,9 +598,9 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) { case WebInputEvent::MouseDown: if (!popup()) { SetCapture(view_); - // This mimics a temporary workaround in RenderWidgetHostViewWin - // for bug 765011 to get focus when the mouse is clicked. This - // happens after the mouse down event is sent to the renderer + // This mimics a temporary workaround in RenderWidgetHostViewWin + // for bug 765011 to get focus when the mouse is clicked. This + // happens after the mouse down event is sent to the renderer // because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN. ::SetFocus(view_); } @@ -645,7 +641,7 @@ void WebWidgetHost::OnNotify(WPARAM wparam, NMHDR* header) { return; switch (header->code) { - case TTN_GETDISPINFO: + case TTN_GETDISPINFO: { NMTTDISPINFOW* tooltip_info = reinterpret_cast(header); tooltip_info->szText[0] = L'\0'; @@ -679,8 +675,7 @@ void WebWidgetHost::SetTooltipText(const CefString& tooltip_text) { ::SendMessage(tooltip_view_, TTM_POP, 0, 0); ::SendMessage(tooltip_view_, TTM_POPUP, 0, 0); } - } - else { + } else { // Make sure the tooltip gets closed after TTN_POP gets sent. For some // reason this doesn't happen automatically, so moving the mouse around // within the same link/image/etc doesn't cause the tooltip to re-appear. @@ -754,7 +749,7 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) { if (!popup() && ((WebKit::WebView*)webwidget_)->isTransparent()) { // When using transparency mode clear the rectangle before painting. SkPaint clearpaint; - clearpaint.setARGB(0,0,0,0); + clearpaint.setARGB(0, 0, 0, 0); clearpaint.setXfermodeMode(SkXfermode::kClear_Mode); SkRect skrc; @@ -768,8 +763,7 @@ void WebWidgetHost::PaintRect(const gfx::Rect& rect) { } void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers, - bool sysChar, bool imeChar) -{ + bool sysChar, bool imeChar) { UINT message = 0; WPARAM wparam = key; LPARAM lparam = modifiers; @@ -777,21 +771,21 @@ void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers, if (type == KT_KEYUP) { if (sysChar) message = WM_SYSKEYUP; - else if(imeChar) + else if (imeChar) message = WM_IME_KEYUP; else message = WM_KEYUP; - } else if(type == KT_KEYDOWN) { + } else if (type == KT_KEYDOWN) { if (sysChar) message = WM_SYSKEYDOWN; - else if(imeChar) + else if (imeChar) message = WM_IME_KEYDOWN; else message = WM_KEYDOWN; - } else if(type == KT_CHAR) { + } else if (type == KT_CHAR) { if (sysChar) message = WM_SYSCHAR; - else if(imeChar) + else if (imeChar) message = WM_IME_CHAR; else message = WM_CHAR; @@ -811,27 +805,26 @@ void WebWidgetHost::SendKeyEvent(cef_key_type_t type, int key, int modifiers, void WebWidgetHost::SendMouseClickEvent(int x, int y, cef_mouse_button_type_t type, - bool mouseUp, int clickCount) -{ + bool mouseUp, int clickCount) { DCHECK(clickCount >=1 && clickCount <= 2); - + UINT message = 0; WPARAM wparam = 0; LPARAM lparam = MAKELPARAM(x, y); if (type == MBT_LEFT) { if (mouseUp) - message = (clickCount==1?WM_LBUTTONUP:WM_LBUTTONDBLCLK); + message = (clickCount == 1?WM_LBUTTONUP:WM_LBUTTONDBLCLK); else message = WM_LBUTTONDOWN; } else if (type == MBT_MIDDLE) { if (mouseUp) - message = (clickCount==1?WM_MBUTTONUP:WM_MBUTTONDBLCLK); + message = (clickCount == 1?WM_MBUTTONUP:WM_MBUTTONDBLCLK); else message = WM_MBUTTONDOWN; } else if (type == MBT_RIGHT) { if (mouseUp) - message = (clickCount==1?WM_RBUTTONUP:WM_RBUTTONDBLCLK); + message = (clickCount == 1?WM_RBUTTONUP:WM_RBUTTONDBLCLK); else message = WM_RBUTTONDOWN; } @@ -840,7 +833,7 @@ void WebWidgetHost::SendMouseClickEvent(int x, int y, NOTREACHED(); return; } - + if (GetKeyState(VK_CONTROL) & 0x8000) wparam |= MK_CONTROL; if (GetKeyState(VK_SHIFT) & 0x8000) @@ -862,12 +855,11 @@ void WebWidgetHost::SendMouseClickEvent(int x, int y, } } -void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) -{ +void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) { UINT message; WPARAM wparam = 0; LPARAM lparam = 0; - + if (mouseLeave) { message = WM_MOUSELEAVE; } else { @@ -896,11 +888,10 @@ void WebWidgetHost::SendMouseMoveEvent(int x, int y, bool mouseLeave) } } -void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) -{ +void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) { WPARAM wparam = MAKEWPARAM(0, delta); LPARAM lparam = MAKELPARAM(x, y); - + if (GetKeyState(VK_CONTROL) & 0x8000) wparam |= MK_CONTROL; if (GetKeyState(VK_SHIFT) & 0x8000) @@ -922,19 +913,16 @@ void WebWidgetHost::SendMouseWheelEvent(int x, int y, int delta) } } -void WebWidgetHost::SendFocusEvent(bool setFocus) -{ +void WebWidgetHost::SendFocusEvent(bool setFocus) { SetFocus(setFocus); } -void WebWidgetHost::SendCaptureLostEvent() -{ +void WebWidgetHost::SendCaptureLostEvent() { CaptureLostEvent(); } LRESULT WebWidgetHost::OnImeSetContext(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) -{ + LPARAM lparam, BOOL& handled) { if (!webwidget_) return 0; @@ -962,8 +950,7 @@ LRESULT WebWidgetHost::OnImeSetContext(UINT message, WPARAM wparam, } LRESULT WebWidgetHost::OnImeStartComposition(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) -{ + LPARAM lparam, BOOL& handled) { if (!webwidget_) return 0; @@ -978,8 +965,7 @@ LRESULT WebWidgetHost::OnImeStartComposition(UINT message, WPARAM wparam, } LRESULT WebWidgetHost::OnImeComposition(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) -{ + LPARAM lparam, BOOL& handled) { if (!webwidget_) return 0; @@ -1029,8 +1015,7 @@ LRESULT WebWidgetHost::OnImeComposition(UINT message, WPARAM wparam, } LRESULT WebWidgetHost::OnImeEndComposition(UINT message, WPARAM wparam, - LPARAM lparam, BOOL& handled) -{ + LPARAM lparam, BOOL& handled) { if (!webwidget_) return 0; @@ -1049,8 +1034,7 @@ LRESULT WebWidgetHost::OnImeEndComposition(UINT message, WPARAM wparam, } void WebWidgetHost::OnInputLangChange(DWORD character_set, - HKL input_language_id) -{ + HKL input_language_id) { // Send the given Locale ID to the ImeInput object and retrieves whether // or not the current input context has IMEs. // If the current input context has IMEs, a browser process has to send a @@ -1088,8 +1072,7 @@ void WebWidgetHost::OnInputLangChange(DWORD character_set, } void WebWidgetHost::ImeUpdateTextInputState(WebKit::WebTextInputType type, - const gfx::Rect& caret_rect) -{ + const gfx::Rect& caret_rect) { if (text_input_type_ != type) { text_input_type_ = type; if (type == WebKit::WebTextInputTypeText) @@ -1103,8 +1086,7 @@ void WebWidgetHost::ImeUpdateTextInputState(WebKit::WebTextInputType type, ime_input_.UpdateCaretRect(view_, caret_rect); } -void WebWidgetHost::UpdateInputMethod() -{ +void WebWidgetHost::UpdateInputMethod() { REQUIRE_UIT(); has_update_input_method_task_ = false; diff --git a/libcef/xml_reader_impl.cc b/libcef/xml_reader_impl.cc index f0fecc418..27a4106f7 100644 --- a/libcef/xml_reader_impl.cc +++ b/libcef/xml_reader_impl.cc @@ -2,17 +2,16 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "xml_reader_impl.h" +#include "libcef/xml_reader_impl.h" #include "include/cef_stream.h" #include "base/logging.h" // Static functions -//static +// static CefRefPtr CefXmlReader::Create(CefRefPtr stream, EncodingType encodingType, - const CefString& URI) -{ + const CefString& URI) { CefRefPtr impl(new CefXmlReaderImpl()); if (!impl->Initialize(stream, encodingType, URI)) return NULL; @@ -34,8 +33,7 @@ namespace { * * Returns the number of bytes read or -1 in case of error */ -int XMLCALL xml_read_callback(void * context, char * buffer, int len) -{ +int XMLCALL xml_read_callback(void * context, char * buffer, int len) { CefRefPtr reader(static_cast(context)); return reader->Read(buffer, 1, len); } @@ -50,20 +48,20 @@ int XMLCALL xml_read_callback(void * context, char * buffer, int len) * Signature of an error callback from a reader parser */ void XMLCALL xml_error_callback(void *arg, const char *msg, - xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) -{ + xmlParserSeverities severity, + xmlTextReaderLocatorPtr locator) { if (!msg) return; std::string error_str(msg); if (!error_str.empty() && error_str[error_str.length()-1] == '\n') error_str.resize(error_str.length()-1); - + std::stringstream ss; ss << error_str << ", line " << xmlTextReaderLocatorLineNumber(locator); LOG(INFO) << ss.str(); - + CefRefPtr impl(static_cast(arg)); impl->AppendError(ss.str()); } @@ -76,51 +74,47 @@ void XMLCALL xml_error_callback(void *arg, const char *msg, * Signature of the function to use when there is an error and * the module handles the new error reporting mechanism. */ -void XMLCALL xml_structured_error_callback(void *userData, xmlErrorPtr error) -{ +void XMLCALL xml_structured_error_callback(void *userData, xmlErrorPtr error) { if (!error->message) return; std::string error_str(error->message); if (!error_str.empty() && error_str[error_str.length()-1] == '\n') error_str.resize(error_str.length()-1); - + std::stringstream ss; ss << error_str << ", line " << error->line; LOG(INFO) << ss.str(); - + CefRefPtr impl(static_cast(userData)); impl->AppendError(ss.str()); } -CefString xmlCharToString(const xmlChar* xmlStr, bool free) -{ +CefString xmlCharToString(const xmlChar* xmlStr, bool free) { if (!xmlStr) return CefString(); const char* str = reinterpret_cast(xmlStr); CefString wstr = std::string(str); - + if (free) xmlFree(const_cast(xmlStr)); - + return wstr; } -} // namespace +} // namespace CefXmlReaderImpl::CefXmlReaderImpl() - : supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL) -{ + : supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL) { } -CefXmlReaderImpl::~CefXmlReaderImpl() -{ +CefXmlReaderImpl::~CefXmlReaderImpl() { if (reader_ != NULL) { if (!VerifyContext()) { // Close() is supposed to be called directly. We'll try to free the reader - // now on the wrong thread but there's no guarantee this call won't crash. + // now on the wrong thread but there's no guarantee this call won't crash. xmlFreeTextReader(reader_); } else { Close(); @@ -130,8 +124,7 @@ CefXmlReaderImpl::~CefXmlReaderImpl() bool CefXmlReaderImpl::Initialize(CefRefPtr stream, EncodingType encodingType, - const CefString& URI) -{ + const CefString& URI) { xmlCharEncoding enc = XML_CHAR_ENCODING_NONE; switch (encodingType) { case XML_ENCODING_UTF8: @@ -174,20 +167,18 @@ bool CefXmlReaderImpl::Initialize(CefRefPtr stream, xmlTextReaderSetErrorHandler(reader_, xml_error_callback, this); xmlTextReaderSetStructuredErrorHandler(reader_, xml_structured_error_callback, this); - + return true; } -bool CefXmlReaderImpl::MoveToNextNode() -{ +bool CefXmlReaderImpl::MoveToNextNode() { if (!VerifyContext()) return false; return xmlTextReaderRead(reader_) == 1 ? true : false; } -bool CefXmlReaderImpl::Close() -{ +bool CefXmlReaderImpl::Close() { if (!VerifyContext()) return false; @@ -197,24 +188,21 @@ bool CefXmlReaderImpl::Close() return true; } -bool CefXmlReaderImpl::HasError() -{ +bool CefXmlReaderImpl::HasError() { if (!VerifyContext()) return false; return !error_buf_.str().empty(); } -CefString CefXmlReaderImpl::GetError() -{ +CefString CefXmlReaderImpl::GetError() { if (!VerifyContext()) return CefString(); return error_buf_.str(); } -CefXmlReader::NodeType CefXmlReaderImpl::GetType() -{ +CefXmlReader::NodeType CefXmlReaderImpl::GetType() { if (!VerifyContext()) return XML_NODE_UNSUPPORTED; @@ -247,72 +235,63 @@ CefXmlReader::NodeType CefXmlReaderImpl::GetType() return XML_NODE_UNSUPPORTED; } -int CefXmlReaderImpl::GetDepth() -{ +int CefXmlReaderImpl::GetDepth() { if (!VerifyContext()) return -1; return xmlTextReaderDepth(reader_); } -CefString CefXmlReaderImpl::GetLocalName() -{ +CefString CefXmlReaderImpl::GetLocalName() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderConstLocalName(reader_), false); } -CefString CefXmlReaderImpl::GetPrefix() -{ +CefString CefXmlReaderImpl::GetPrefix() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderConstPrefix(reader_), false); } -CefString CefXmlReaderImpl::GetQualifiedName() -{ +CefString CefXmlReaderImpl::GetQualifiedName() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderConstName(reader_), false); } -CefString CefXmlReaderImpl::GetNamespaceURI() -{ +CefString CefXmlReaderImpl::GetNamespaceURI() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderConstNamespaceUri(reader_), false); } -CefString CefXmlReaderImpl::GetBaseURI() -{ +CefString CefXmlReaderImpl::GetBaseURI() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderConstBaseUri(reader_), false); } -CefString CefXmlReaderImpl::GetXmlLang() -{ +CefString CefXmlReaderImpl::GetXmlLang() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderConstXmlLang(reader_), false); } -bool CefXmlReaderImpl::IsEmptyElement() -{ +bool CefXmlReaderImpl::IsEmptyElement() { if (!VerifyContext()) return false; return xmlTextReaderIsEmptyElement(reader_) == 1 ? true : false; } -bool CefXmlReaderImpl::HasValue() -{ +bool CefXmlReaderImpl::HasValue() { if (!VerifyContext()) return false; @@ -324,8 +303,7 @@ bool CefXmlReaderImpl::HasValue() } } -CefString CefXmlReaderImpl::GetValue() -{ +CefString CefXmlReaderImpl::GetValue() { if (!VerifyContext()) return CefString(); @@ -340,32 +318,28 @@ CefString CefXmlReaderImpl::GetValue() } } -bool CefXmlReaderImpl::HasAttributes() -{ +bool CefXmlReaderImpl::HasAttributes() { if (!VerifyContext()) return false; return xmlTextReaderHasAttributes(reader_) == 1 ? true : false; } -size_t CefXmlReaderImpl::GetAttributeCount() -{ +size_t CefXmlReaderImpl::GetAttributeCount() { if (!VerifyContext()) return 0; return xmlTextReaderAttributeCount(reader_); } -CefString CefXmlReaderImpl::GetAttribute(int index) -{ +CefString CefXmlReaderImpl::GetAttribute(int index) { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderGetAttributeNo(reader_, index), true); } -CefString CefXmlReaderImpl::GetAttribute(const CefString& qualifiedName) -{ +CefString CefXmlReaderImpl::GetAttribute(const CefString& qualifiedName) { if (!VerifyContext()) return CefString(); @@ -375,8 +349,7 @@ CefString CefXmlReaderImpl::GetAttribute(const CefString& qualifiedName) } CefString CefXmlReaderImpl::GetAttribute(const CefString& localName, - const CefString& namespaceURI) -{ + const CefString& namespaceURI) { if (!VerifyContext()) return CefString(); @@ -386,40 +359,35 @@ CefString CefXmlReaderImpl::GetAttribute(const CefString& localName, BAD_CAST localNameStr.c_str(), BAD_CAST namespaceURIStr.c_str()), true); } -CefString CefXmlReaderImpl::GetInnerXml() -{ +CefString CefXmlReaderImpl::GetInnerXml() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderReadInnerXml(reader_), true); } -CefString CefXmlReaderImpl::GetOuterXml() -{ +CefString CefXmlReaderImpl::GetOuterXml() { if (!VerifyContext()) return CefString(); return xmlCharToString(xmlTextReaderReadOuterXml(reader_), true); } -int CefXmlReaderImpl::GetLineNumber() -{ +int CefXmlReaderImpl::GetLineNumber() { if (!VerifyContext()) return -1; return xmlTextReaderGetParserLineNumber(reader_); } -bool CefXmlReaderImpl::MoveToAttribute(int index) -{ +bool CefXmlReaderImpl::MoveToAttribute(int index) { if (!VerifyContext()) return false; return xmlTextReaderMoveToAttributeNo(reader_, index) == 1 ? true : false; } -bool CefXmlReaderImpl::MoveToAttribute(const CefString& qualifiedName) -{ +bool CefXmlReaderImpl::MoveToAttribute(const CefString& qualifiedName) { if (!VerifyContext()) return false; @@ -429,8 +397,7 @@ bool CefXmlReaderImpl::MoveToAttribute(const CefString& qualifiedName) } bool CefXmlReaderImpl::MoveToAttribute(const CefString& localName, - const CefString& namespaceURI) -{ + const CefString& namespaceURI) { if (!VerifyContext()) return false; @@ -441,39 +408,34 @@ bool CefXmlReaderImpl::MoveToAttribute(const CefString& localName, true : false; } -bool CefXmlReaderImpl::MoveToFirstAttribute() -{ +bool CefXmlReaderImpl::MoveToFirstAttribute() { if (!VerifyContext()) return false; return xmlTextReaderMoveToFirstAttribute(reader_) == 1 ? true : false; } -bool CefXmlReaderImpl::MoveToNextAttribute() -{ +bool CefXmlReaderImpl::MoveToNextAttribute() { if (!VerifyContext()) return false; return xmlTextReaderMoveToNextAttribute(reader_) == 1 ? true : false; } -bool CefXmlReaderImpl::MoveToCarryingElement() -{ +bool CefXmlReaderImpl::MoveToCarryingElement() { if (!VerifyContext()) return false; return xmlTextReaderMoveToElement(reader_) == 1 ? true : false; } -void CefXmlReaderImpl::AppendError(const CefString& error_str) -{ +void CefXmlReaderImpl::AppendError(const CefString& error_str) { if (!error_buf_.str().empty()) error_buf_ << L"\n"; error_buf_ << error_str; } -bool CefXmlReaderImpl::VerifyContext() -{ +bool CefXmlReaderImpl::VerifyContext() { if (base::PlatformThread::CurrentId() != supported_thread_id_) { // This object should only be accessed from the thread that created it. NOTREACHED(); diff --git a/libcef/xml_reader_impl.h b/libcef/xml_reader_impl.h index a0523a922..714be0a33 100644 --- a/libcef/xml_reader_impl.h +++ b/libcef/xml_reader_impl.h @@ -2,18 +2,19 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _XML_READER_IMPL_H -#define _XML_READER_IMPL_H +#ifndef CEF_LIBCEF_XML_READER_IMPL_H_ +#define CEF_LIBCEF_XML_READER_IMPL_H_ +#pragma once -#include "include/cef_xml_reader.h" -#include "base/threading/platform_thread.h" #include #include +#include "include/cef_xml_reader.h" +#include "base/threading/platform_thread.h" + // Implementation of CefXmlReader -class CefXmlReaderImpl : public CefXmlReader -{ -public: +class CefXmlReaderImpl : public CefXmlReader { + public: CefXmlReaderImpl(); ~CefXmlReaderImpl(); @@ -60,7 +61,7 @@ public: // thread. bool VerifyContext(); -protected: + protected: base::PlatformThreadId supported_thread_id_; CefRefPtr stream_; xmlTextReaderPtr reader_; @@ -69,4 +70,4 @@ protected: IMPLEMENT_REFCOUNTING(CefXMLReaderImpl); }; -#endif // _XML_READER_IMPL_H +#endif // CEF_LIBCEF_XML_READER_IMPL_H_ diff --git a/libcef/zip_reader_impl.cc b/libcef/zip_reader_impl.cc index 423ae52e3..8ab50342a 100644 --- a/libcef/zip_reader_impl.cc +++ b/libcef/zip_reader_impl.cc @@ -2,16 +2,16 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "zip_reader_impl.h" +#include "libcef/zip_reader_impl.h" +#include #include "include/cef_stream.h" #include "base/logging.h" -#include // Static functions -//static -CefRefPtr CefZipReader::Create(CefRefPtr stream) -{ +// static +CefRefPtr CefZipReader::Create( + CefRefPtr stream) { CefRefPtr impl(new CefZipReaderImpl()); if (!impl->Initialize(stream)) return NULL; @@ -23,29 +23,26 @@ CefRefPtr CefZipReader::Create(CefRefPtr stream) namespace { -voidpf ZCALLBACK zlib_open_callback OF((voidpf opaque, const char* filename, - int mode)) -{ +voidpf ZCALLBACK zlib_open_callback OF((voidpf opaque, const void* filename, + int mode)) { // The stream is already implicitly open so just return the pointer. return opaque; } uLong ZCALLBACK zlib_read_callback OF((voidpf opaque, voidpf stream, void* buf, - uLong size)) -{ + uLong size)) { CefRefPtr reader(static_cast(opaque)); return reader->Read(buf, 1, size); } -long ZCALLBACK zlib_tell_callback OF((voidpf opaque, voidpf stream)) -{ +ZPOS64_T ZCALLBACK zlib_tell_callback OF((voidpf opaque, voidpf stream)) { CefRefPtr reader(static_cast(opaque)); return reader->Tell(); } -long ZCALLBACK zlib_seek_callback OF((voidpf opaque, voidpf stream, - uLong offset, int origin)) -{ +long ZCALLBACK zlib_seek_callback OF((voidpf opaque, // NOLINT(runtime/int) + voidpf stream, ZPOS64_T offset, + int origin)) { CefRefPtr reader(static_cast(opaque)); int whence; switch (origin) { @@ -65,33 +62,32 @@ long ZCALLBACK zlib_seek_callback OF((voidpf opaque, voidpf stream, return reader->Seek(offset, whence); } -int ZCALLBACK zlib_close_callback OF((voidpf opaque, voidpf stream)) -{ +int ZCALLBACK zlib_close_callback OF((voidpf opaque, voidpf stream)) { CefRefPtr reader(static_cast(opaque)); // Release the reference added by CefZipReaderImpl::Initialize(). reader->Release(); return 0; } -int ZCALLBACK zlib_error_callback OF((voidpf opaque, voidpf stream)) -{ +int ZCALLBACK zlib_error_callback OF((voidpf opaque, voidpf stream)) { return 0; } -} // namespace +} // namespace CefZipReaderImpl::CefZipReaderImpl() : supported_thread_id_(base::PlatformThread::CurrentId()), reader_(NULL), - has_fileopen_(false), has_fileinfo_(false), filesize_(0), filemodified_(0) -{ + has_fileopen_(false), + has_fileinfo_(false), + filesize_(0), + filemodified_(0) { } -CefZipReaderImpl::~CefZipReaderImpl() -{ +CefZipReaderImpl::~CefZipReaderImpl() { if (reader_ != NULL) { if (!VerifyContext()) { // Close() is supposed to be called directly. We'll try to free the reader - // now on the wrong thread but there's no guarantee this call won't crash. + // now on the wrong thread but there's no guarantee this call won't crash. if (has_fileopen_) unzCloseCurrentFile(reader_); unzClose(reader_); @@ -101,27 +97,25 @@ CefZipReaderImpl::~CefZipReaderImpl() } } -bool CefZipReaderImpl::Initialize(CefRefPtr stream) -{ - zlib_filefunc_def filefunc_def; - filefunc_def.zopen_file = zlib_open_callback; +bool CefZipReaderImpl::Initialize(CefRefPtr stream) { + zlib_filefunc64_def filefunc_def; + filefunc_def.zopen64_file = zlib_open_callback; filefunc_def.zread_file = zlib_read_callback; filefunc_def.zwrite_file = NULL; - filefunc_def.ztell_file = zlib_tell_callback; - filefunc_def.zseek_file = zlib_seek_callback; + filefunc_def.ztell64_file = zlib_tell_callback; + filefunc_def.zseek64_file = zlib_seek_callback; filefunc_def.zclose_file = zlib_close_callback; filefunc_def.zerror_file = zlib_error_callback; filefunc_def.opaque = stream.get(); // Add a reference that will be released by zlib_close_callback(). stream->AddRef(); - - reader_ = unzOpen2("", &filefunc_def); + + reader_ = unzOpen2_64("", &filefunc_def); return (reader_ != NULL); } -bool CefZipReaderImpl::MoveToFirstFile() -{ +bool CefZipReaderImpl::MoveToFirstFile() { if (!VerifyContext()) return false; @@ -133,8 +127,7 @@ bool CefZipReaderImpl::MoveToFirstFile() return (unzGoToFirstFile(reader_) == UNZ_OK); } -bool CefZipReaderImpl::MoveToNextFile() -{ +bool CefZipReaderImpl::MoveToNextFile() { if (!VerifyContext()) return false; @@ -146,8 +139,8 @@ bool CefZipReaderImpl::MoveToNextFile() return (unzGoToNextFile(reader_) == UNZ_OK); } -bool CefZipReaderImpl::MoveToFile(const CefString& fileName, bool caseSensitive) -{ +bool CefZipReaderImpl::MoveToFile(const CefString& fileName, + bool caseSensitive) { if (!VerifyContext()) return false; @@ -161,8 +154,7 @@ bool CefZipReaderImpl::MoveToFile(const CefString& fileName, bool caseSensitive) (caseSensitive ? 1 : 2)) == UNZ_OK); } -bool CefZipReaderImpl::Close() -{ +bool CefZipReaderImpl::Close() { if (!VerifyContext()) return false; @@ -174,32 +166,28 @@ bool CefZipReaderImpl::Close() return (result == UNZ_OK); } -CefString CefZipReaderImpl::GetFileName() -{ +CefString CefZipReaderImpl::GetFileName() { if (!VerifyContext() || !GetFileInfo()) return CefString(); return filename_; } -long CefZipReaderImpl::GetFileSize() -{ +int64 CefZipReaderImpl::GetFileSize() { if (!VerifyContext() || !GetFileInfo()) return -1; return filesize_; } -time_t CefZipReaderImpl::GetFileLastModified() -{ +time_t CefZipReaderImpl::GetFileLastModified() { if (!VerifyContext() || !GetFileInfo()) return 0; return filemodified_; } -bool CefZipReaderImpl::OpenFile(const CefString& password) -{ +bool CefZipReaderImpl::OpenFile(const CefString& password) { if (!VerifyContext()) return false; @@ -220,8 +208,7 @@ bool CefZipReaderImpl::OpenFile(const CefString& password) return ret; } -bool CefZipReaderImpl::CloseFile() -{ +bool CefZipReaderImpl::CloseFile() { if (!VerifyContext() || !has_fileopen_) return false; @@ -231,35 +218,31 @@ bool CefZipReaderImpl::CloseFile() return (unzCloseCurrentFile(reader_) == UNZ_OK); } -int CefZipReaderImpl::ReadFile(void* buffer, size_t bufferSize) -{ +int CefZipReaderImpl::ReadFile(void* buffer, size_t bufferSize) { if (!VerifyContext() || !has_fileopen_) return -1; return unzReadCurrentFile(reader_, buffer, bufferSize); } -long CefZipReaderImpl::Tell() -{ +int64 CefZipReaderImpl::Tell() { if (!VerifyContext() || !has_fileopen_) return -1; - return unztell(reader_); + return unztell64(reader_); } -bool CefZipReaderImpl::Eof() -{ +bool CefZipReaderImpl::Eof() { if (!VerifyContext() || !has_fileopen_) return true; return (unzeof(reader_) == 1 ? true : false); } -bool CefZipReaderImpl::GetFileInfo() -{ +bool CefZipReaderImpl::GetFileInfo() { if (has_fileinfo_) return true; - + char file_name[512] = {0}; unz_file_info file_info; memset(&file_info, 0, sizeof(file_info)); @@ -272,7 +255,7 @@ bool CefZipReaderImpl::GetFileInfo() has_fileinfo_ = true; filename_ = std::string(file_name); filesize_ = file_info.uncompressed_size; - + struct tm time; memset(&time, 0, sizeof(time)); time.tm_sec = file_info.tmu_date.tm_sec; @@ -286,8 +269,7 @@ bool CefZipReaderImpl::GetFileInfo() return true; } -bool CefZipReaderImpl::VerifyContext() -{ +bool CefZipReaderImpl::VerifyContext() { if (base::PlatformThread::CurrentId() != supported_thread_id_) { // This object should only be accessed from the thread that created it. NOTREACHED(); diff --git a/libcef/zip_reader_impl.h b/libcef/zip_reader_impl.h index a48fb5d2b..fa8d194ad 100644 --- a/libcef/zip_reader_impl.h +++ b/libcef/zip_reader_impl.h @@ -2,18 +2,19 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _ZIP_READER_IMPL_H -#define _ZIP_READER_IMPL_H +#ifndef CEF_LIBCEF_ZIP_READER_IMPL_H_ +#define CEF_LIBCEF_ZIP_READER_IMPL_H_ +#pragma once + +#include #include "include/cef_zip_reader.h" #include "base/threading/platform_thread.h" #include "third_party/zlib/contrib/minizip/unzip.h" -#include // Implementation of CefZipReader -class CefZipReaderImpl : public CefZipReader -{ -public: +class CefZipReaderImpl : public CefZipReader { + public: CefZipReaderImpl(); ~CefZipReaderImpl(); @@ -25,30 +26,30 @@ public: virtual bool MoveToFile(const CefString& fileName, bool caseSensitive); virtual bool Close(); virtual CefString GetFileName(); - virtual long GetFileSize(); + virtual int64 GetFileSize(); virtual time_t GetFileLastModified(); virtual bool OpenFile(const CefString& password); virtual bool CloseFile(); virtual int ReadFile(void* buffer, size_t bufferSize); - virtual long Tell(); + virtual int64 Tell(); virtual bool Eof(); bool GetFileInfo(); - + // Verify that the reader exists and is being accessed from the correct // thread. bool VerifyContext(); -protected: + protected: base::PlatformThreadId supported_thread_id_; unzFile reader_; bool has_fileopen_; bool has_fileinfo_; CefString filename_; - long filesize_; + int64 filesize_; time_t filemodified_; IMPLEMENT_REFCOUNTING(CefZipReaderImpl); }; -#endif // _ZIP_READER_IMPL_H +#endif // CEF_LIBCEF_ZIP_READER_IMPL_H_ diff --git a/libcef_dll/cef_logging.h b/libcef_dll/cef_logging.h index 67fc109ac..5d28a004e 100644 --- a/libcef_dll/cef_logging.h +++ b/libcef_dll/cef_logging.h @@ -2,14 +2,21 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _CEF_LOGGING_H -#define _CEF_LOGGING_H +#ifndef CEF_LIBCEF_DLL_CEF_LOGGING_H_ +#define CEF_LIBCEF_DLL_CEF_LOGGING_H_ +#pragma once #ifdef BUILDING_CEF_SHARED #include "base/logging.h" #else -#include +#include // NOLINT(build/include_order) #define DCHECK(condition) assert(condition) +#define DCHECK_EQ(val1, val2) DCHECK(val1 == val2) +#define DCHECK_NE(val1, val2) DCHECK(val1 != val2) +#define DCHECK_LE(val1, val2) DCHECK(val1 <= val2) +#define DCHECK_LT(val1, val2) DCHECK(val1 < val2) +#define DCHECK_GE(val1, val2) DCHECK(val1 >= val2) +#define DCHECK_GT(val1, val2) DCHECK(val1 > val2) #endif -#endif // _CEF_LOGGING_H +#endif // CEF_LIBCEF_DLL_CEF_LOGGING_H_ diff --git a/libcef_dll/cpptoc/app_cpptoc.cc b/libcef_dll/cpptoc/app_cpptoc.cc index b7c58ef63..bc19c9564 100644 --- a/libcef_dll/cpptoc/app_cpptoc.cc +++ b/libcef_dll/cpptoc/app_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. struct _cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler( - struct _cef_app_t* self) -{ + struct _cef_app_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -37,8 +36,7 @@ struct _cef_proxy_handler_t* CEF_CALLBACK app_get_proxy_handler( // CONSTRUCTOR - Do not edit by hand. CefAppCppToC::CefAppCppToC(CefApp* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_proxy_handler = app_get_proxy_handler; } diff --git a/libcef_dll/cpptoc/app_cpptoc.h b/libcef_dll/cpptoc/app_cpptoc.h index b39acacf1..0809df8b4 100644 --- a/libcef_dll/cpptoc/app_cpptoc.h +++ b/libcef_dll/cpptoc/app_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _APP_CPPTOC_H -#define _APP_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_app.h" #include "include/capi/cef_app_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefAppCppToC - : public CefCppToC -{ -public: - CefAppCppToC(CefApp* cls); + : public CefCppToC { + public: + explicit CefAppCppToC(CefApp* cls); virtual ~CefAppCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _APP_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/base_cpptoc.h b/libcef_dll/cpptoc/base_cpptoc.h index 7de6140f9..1184d718a 100644 --- a/libcef_dll/cpptoc/base_cpptoc.h +++ b/libcef_dll/cpptoc/base_cpptoc.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _BASE_CPPTOC_H -#define _BASE_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ +#pragma once #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" @@ -11,15 +12,13 @@ // CefCppToC implementation for CefBase. -class CefBaseCppToC : public CefBase -{ -public: +class CefBaseCppToC : public CefBase { + public: // Use this method to retrieve the underlying class instance from our // own structure when the structure is passed as the required first // parameter of a C API function call. No explicit reference counting // is done in this case. - static CefRefPtr Get(cef_base_t* s) - { + static CefRefPtr Get(cef_base_t* s) { DCHECK(s); // Cast our structure to the wrapper structure type. @@ -28,11 +27,10 @@ public: // Return the underlying object instance. return wrapperStruct->class_->GetClass(); } - + // Use this method to create a wrapper structure for passing our class // instance to the other side. - static cef_base_t* Wrap(CefRefPtr c) - { + static cef_base_t* Wrap(CefRefPtr c) { if (!c.get()) return NULL; @@ -47,8 +45,7 @@ public: // Use this method to retrieve the underlying class instance when receiving // our wrapper structure back from the other side. - static CefRefPtr Unwrap(cef_base_t* s) - { + static CefRefPtr Unwrap(cef_base_t* s) { if (!s) return NULL; @@ -65,19 +62,17 @@ public: } // Structure representation with pointer to the C++ class. - struct Struct - { + struct Struct { cef_base_t struct_; CefBaseCppToC* class_; }; - CefBaseCppToC(CefBase* cls) - : class_(cls) - { + explicit CefBaseCppToC(CefBase* cls) + : class_(cls) { DCHECK(cls); struct_.class_ = this; - + // zero the underlying structure and set base members memset(&struct_.struct_, 0, sizeof(cef_base_t)); struct_.struct_.size = sizeof(cef_base_t); @@ -96,13 +91,11 @@ public: // CefBase methods increment/decrement reference counts on both this object // and the underlying wrapper class. - int AddRef() - { + int AddRef() { UnderlyingAddRef(); return refct_.AddRef(); } - int Release() - { + int Release() { UnderlyingRelease(); int retval = refct_.Release(); if (retval == 0) @@ -116,41 +109,38 @@ public: int UnderlyingRelease() { return class_->Release(); } int UnderlyingGetRefCt() { return class_->GetRefCt(); } -private: - static int CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) - { + private: + static int CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) { DCHECK(base); - if(!base) + if (!base) return 0; Struct* impl = reinterpret_cast(base); return impl->class_->AddRef(); } - static int CEF_CALLBACK struct_release(struct _cef_base_t* base) - { + static int CEF_CALLBACK struct_release(struct _cef_base_t* base) { DCHECK(base); - if(!base) + if (!base) return 0; Struct* impl = reinterpret_cast(base); return impl->class_->Release(); } - static int CEF_CALLBACK struct_get_refct(struct _cef_base_t* base) - { + static int CEF_CALLBACK struct_get_refct(struct _cef_base_t* base) { DCHECK(base); - if(!base) + if (!base) return 0; Struct* impl = reinterpret_cast(base); return impl->class_->GetRefCt(); } -protected: + protected: CefRefCount refct_; Struct struct_; CefBase* class_; }; -#endif // _BASE_CPPTOC_H +#endif // CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc index 6b32f95da..431b27a7d 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo, struct _cef_client_t* client, const cef_string_t* url, - const struct _cef_browser_settings_t* settings) -{ + const struct _cef_browser_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: windowInfo; type: struct_byref @@ -64,8 +63,7 @@ CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo, CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, struct _cef_client_t* client, const cef_string_t* url, - const struct _cef_browser_settings_t* settings) -{ + const struct _cef_browser_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: windowInfo; type: struct_byref @@ -109,8 +107,8 @@ CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo, // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK browser_parent_window_will_close(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_parent_window_will_close( + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -121,8 +119,7 @@ void CEF_CALLBACK browser_parent_window_will_close(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ParentWindowWillClose(); } -void CEF_CALLBACK browser_close_browser(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_close_browser(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -133,8 +130,7 @@ void CEF_CALLBACK browser_close_browser(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->CloseBrowser(); } -int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) -{ +int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,8 +144,7 @@ int CEF_CALLBACK browser_can_go_back(struct _cef_browser_t* self) return _retval; } -void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -160,8 +155,7 @@ void CEF_CALLBACK browser_go_back(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->GoBack(); } -int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) -{ +int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -175,8 +169,7 @@ int CEF_CALLBACK browser_can_go_forward(struct _cef_browser_t* self) return _retval; } -void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -187,8 +180,7 @@ void CEF_CALLBACK browser_go_forward(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->GoForward(); } -void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -199,8 +191,7 @@ void CEF_CALLBACK browser_reload(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->Reload(); } -void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -211,8 +202,7 @@ void CEF_CALLBACK browser_reload_ignore_cache(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ReloadIgnoreCache(); } -void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -223,8 +213,7 @@ void CEF_CALLBACK browser_stop_load(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->StopLoad(); } -void CEF_CALLBACK browser_set_focus(struct _cef_browser_t* self, int enable) -{ +void CEF_CALLBACK browser_set_focus(struct _cef_browser_t* self, int enable) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -237,8 +226,7 @@ void CEF_CALLBACK browser_set_focus(struct _cef_browser_t* self, int enable) } cef_window_handle_t CEF_CALLBACK browser_get_window_handle( - struct _cef_browser_t* self) -{ + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -253,8 +241,7 @@ cef_window_handle_t CEF_CALLBACK browser_get_window_handle( } cef_window_handle_t CEF_CALLBACK browser_get_opener_window_handle( - struct _cef_browser_t* self) -{ + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -269,8 +256,7 @@ cef_window_handle_t CEF_CALLBACK browser_get_opener_window_handle( return _retval; } -int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) -{ +int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -284,8 +270,7 @@ int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self) return _retval; } -int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) -{ +int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -300,8 +285,7 @@ int CEF_CALLBACK browser_has_document(struct _cef_browser_t* self) } struct _cef_client_t* CEF_CALLBACK browser_get_client( - struct _cef_browser_t* self) -{ + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -316,8 +300,7 @@ struct _cef_client_t* CEF_CALLBACK browser_get_client( } struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( - struct _cef_browser_t* self) -{ + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -332,8 +315,7 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_main_frame( } struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( - struct _cef_browser_t* self) -{ + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -348,8 +330,7 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_focused_frame( } struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, - const cef_string_t* name) -{ + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -369,8 +350,7 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, } void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, - cef_string_list_t names) -{ + cef_string_list_t names) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -395,8 +375,8 @@ void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, } void CEF_CALLBACK browser_find(struct _cef_browser_t* self, int identifier, - const cef_string_t* searchText, int forward, int matchCase, int findNext) -{ + const cef_string_t* searchText, int forward, int matchCase, + int findNext) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -417,8 +397,7 @@ void CEF_CALLBACK browser_find(struct _cef_browser_t* self, int identifier, } void CEF_CALLBACK browser_stop_finding(struct _cef_browser_t* self, - int clearSelection) -{ + int clearSelection) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -430,8 +409,7 @@ void CEF_CALLBACK browser_stop_finding(struct _cef_browser_t* self, clearSelection?true:false); } -double CEF_CALLBACK browser_get_zoom_level(struct _cef_browser_t* self) -{ +double CEF_CALLBACK browser_get_zoom_level(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -446,8 +424,7 @@ double CEF_CALLBACK browser_get_zoom_level(struct _cef_browser_t* self) } void CEF_CALLBACK browser_set_zoom_level(struct _cef_browser_t* self, - double zoomLevel) -{ + double zoomLevel) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -459,8 +436,7 @@ void CEF_CALLBACK browser_set_zoom_level(struct _cef_browser_t* self, zoomLevel); } -void CEF_CALLBACK browser_clear_history(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_clear_history(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -471,8 +447,7 @@ void CEF_CALLBACK browser_clear_history(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ClearHistory(); } -void CEF_CALLBACK browser_show_dev_tools(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_show_dev_tools(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -483,8 +458,7 @@ void CEF_CALLBACK browser_show_dev_tools(struct _cef_browser_t* self) CefBrowserCppToC::Get(self)->ShowDevTools(); } -void CEF_CALLBACK browser_close_dev_tools(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_close_dev_tools(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -496,8 +470,7 @@ void CEF_CALLBACK browser_close_dev_tools(struct _cef_browser_t* self) } int CEF_CALLBACK browser_is_window_rendering_disabled( - struct _cef_browser_t* self) -{ + struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -512,8 +485,7 @@ int CEF_CALLBACK browser_is_window_rendering_disabled( } int CEF_CALLBACK browser_get_size(struct _cef_browser_t* self, - enum cef_paint_element_type_t type, int* width, int* height) -{ + enum cef_paint_element_type_t type, int* width, int* height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -551,8 +523,7 @@ int CEF_CALLBACK browser_get_size(struct _cef_browser_t* self, } void CEF_CALLBACK browser_set_size(struct _cef_browser_t* self, - enum cef_paint_element_type_t type, int width, int height) -{ + enum cef_paint_element_type_t type, int width, int height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -566,8 +537,7 @@ void CEF_CALLBACK browser_set_size(struct _cef_browser_t* self, height); } -int CEF_CALLBACK browser_is_popup_visible(struct _cef_browser_t* self) -{ +int CEF_CALLBACK browser_is_popup_visible(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -581,8 +551,7 @@ int CEF_CALLBACK browser_is_popup_visible(struct _cef_browser_t* self) return _retval; } -void CEF_CALLBACK browser_hide_popup(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_hide_popup(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -594,8 +563,7 @@ void CEF_CALLBACK browser_hide_popup(struct _cef_browser_t* self) } void CEF_CALLBACK browser_invalidate(struct _cef_browser_t* self, - const cef_rect_t* dirtyRect) -{ + const cef_rect_t* dirtyRect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -615,8 +583,7 @@ void CEF_CALLBACK browser_invalidate(struct _cef_browser_t* self, } int CEF_CALLBACK browser_get_image(struct _cef_browser_t* self, - enum cef_paint_element_type_t type, int width, int height, void* buffer) -{ + enum cef_paint_element_type_t type, int width, int height, void* buffer) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -640,8 +607,7 @@ int CEF_CALLBACK browser_get_image(struct _cef_browser_t* self, void CEF_CALLBACK browser_send_key_event(struct _cef_browser_t* self, enum cef_key_type_t type, int key, int modifiers, int sysChar, - int imeChar) -{ + int imeChar) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -659,8 +625,7 @@ void CEF_CALLBACK browser_send_key_event(struct _cef_browser_t* self, void CEF_CALLBACK browser_send_mouse_click_event(struct _cef_browser_t* self, int x, int y, enum cef_mouse_button_type_t type, int mouseUp, - int clickCount) -{ + int clickCount) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -677,8 +642,7 @@ void CEF_CALLBACK browser_send_mouse_click_event(struct _cef_browser_t* self, } void CEF_CALLBACK browser_send_mouse_move_event(struct _cef_browser_t* self, - int x, int y, int mouseLeave) -{ + int x, int y, int mouseLeave) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -693,8 +657,7 @@ void CEF_CALLBACK browser_send_mouse_move_event(struct _cef_browser_t* self, } void CEF_CALLBACK browser_send_mouse_wheel_event(struct _cef_browser_t* self, - int x, int y, int delta) -{ + int x, int y, int delta) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -709,8 +672,7 @@ void CEF_CALLBACK browser_send_mouse_wheel_event(struct _cef_browser_t* self, } void CEF_CALLBACK browser_send_focus_event(struct _cef_browser_t* self, - int setFocus) -{ + int setFocus) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -722,8 +684,7 @@ void CEF_CALLBACK browser_send_focus_event(struct _cef_browser_t* self, setFocus?true:false); } -void CEF_CALLBACK browser_send_capture_lost_event(struct _cef_browser_t* self) -{ +void CEF_CALLBACK browser_send_capture_lost_event(struct _cef_browser_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -738,8 +699,7 @@ void CEF_CALLBACK browser_send_capture_lost_event(struct _cef_browser_t* self) // CONSTRUCTOR - Do not edit by hand. CefBrowserCppToC::CefBrowserCppToC(CefBrowser* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.parent_window_will_close = browser_parent_window_will_close; struct_.struct_.close_browser = browser_close_browser; struct_.struct_.can_go_back = browser_can_go_back; diff --git a/libcef_dll/cpptoc/browser_cpptoc.h b/libcef_dll/cpptoc/browser_cpptoc.h index ec058581d..5caac8502 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.h +++ b/libcef_dll/cpptoc/browser_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _BROWSER_CPPTOC_H -#define _BROWSER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" @@ -28,13 +29,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefBrowserCppToC - : public CefCppToC -{ -public: - CefBrowserCppToC(CefBrowser* cls); + : public CefCppToC { + public: + explicit CefBrowserCppToC(CefBrowser* cls); virtual ~CefBrowserCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _BROWSER_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/client_cpptoc.cc b/libcef_dll/cpptoc/client_cpptoc.cc index 6faf2a669..6ce7df474 100644 --- a/libcef_dll/cpptoc/client_cpptoc.cc +++ b/libcef_dll/cpptoc/client_cpptoc.cc @@ -30,8 +30,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. struct _cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +46,7 @@ struct _cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( } struct _cef_load_handler_t* CEF_CALLBACK client_get_load_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +62,7 @@ struct _cef_load_handler_t* CEF_CALLBACK client_get_load_handler( } struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,8 +78,7 @@ struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler( } struct _cef_display_handler_t* CEF_CALLBACK client_get_display_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +94,7 @@ struct _cef_display_handler_t* CEF_CALLBACK client_get_display_handler( } struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,8 +110,7 @@ struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( } struct _cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -132,8 +126,7 @@ struct _cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( } struct _cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -149,8 +142,7 @@ struct _cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler( } struct _cef_permission_handler_t* CEF_CALLBACK client_get_permission_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -166,8 +158,7 @@ struct _cef_permission_handler_t* CEF_CALLBACK client_get_permission_handler( } struct _cef_print_handler_t* CEF_CALLBACK client_get_print_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -183,8 +174,7 @@ struct _cef_print_handler_t* CEF_CALLBACK client_get_print_handler( } struct _cef_find_handler_t* CEF_CALLBACK client_get_find_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -200,8 +190,7 @@ struct _cef_find_handler_t* CEF_CALLBACK client_get_find_handler( } struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -217,8 +206,7 @@ struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( } struct _cef_v8context_handler_t* CEF_CALLBACK client_get_v8context_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -234,8 +222,7 @@ struct _cef_v8context_handler_t* CEF_CALLBACK client_get_v8context_handler( } struct _cef_render_handler_t* CEF_CALLBACK client_get_render_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -251,8 +238,7 @@ struct _cef_render_handler_t* CEF_CALLBACK client_get_render_handler( } struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( - struct _cef_client_t* self) -{ + struct _cef_client_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -271,8 +257,7 @@ struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( // CONSTRUCTOR - Do not edit by hand. CefClientCppToC::CefClientCppToC(CefClient* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_life_span_handler = client_get_life_span_handler; struct_.struct_.get_load_handler = client_get_load_handler; struct_.struct_.get_request_handler = client_get_request_handler; diff --git a/libcef_dll/cpptoc/client_cpptoc.h b/libcef_dll/cpptoc/client_cpptoc.h index 4067b24c4..1db8e5b12 100644 --- a/libcef_dll/cpptoc/client_cpptoc.h +++ b/libcef_dll/cpptoc/client_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _CLIENT_CPPTOC_H -#define _CLIENT_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_client.h" #include "include/capi/cef_client_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefClientCppToC - : public CefCppToC -{ -public: - CefClientCppToC(CefClient* cls); + : public CefCppToC { + public: + explicit CefClientCppToC(CefClient* cls); virtual ~CefClientCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _CLIENT_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/command_line_cpptoc.cc b/libcef_dll/cpptoc/command_line_cpptoc.cc index 2056b0def..fbdf9c943 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.cc +++ b/libcef_dll/cpptoc/command_line_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_command_line_t* cef_command_line_create() -{ +CEF_EXPORT cef_command_line_t* cef_command_line_create() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -31,8 +30,7 @@ CEF_EXPORT cef_command_line_t* cef_command_line_create() // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, - int argc, const char* const* argv) -{ + int argc, const char* const* argv) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -50,8 +48,7 @@ void CEF_CALLBACK command_line_init_from_argv(struct _cef_command_line_t* self, } void CEF_CALLBACK command_line_init_from_string( - struct _cef_command_line_t* self, const cef_string_t* command_line) -{ + struct _cef_command_line_t* self, const cef_string_t* command_line) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,8 +65,7 @@ void CEF_CALLBACK command_line_init_from_string( } cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( - struct _cef_command_line_t* self) -{ + struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -84,8 +80,7 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string( } cef_string_userfree_t CEF_CALLBACK command_line_get_program( - struct _cef_command_line_t* self) -{ + struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -100,8 +95,7 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_program( } void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, - const cef_string_t* program) -{ + const cef_string_t* program) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -117,8 +111,7 @@ void CEF_CALLBACK command_line_set_program(struct _cef_command_line_t* self, CefString(program)); } -int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) -{ +int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -133,8 +126,7 @@ int CEF_CALLBACK command_line_has_switches(struct _cef_command_line_t* self) } int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, - const cef_string_t* name) -{ + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -154,8 +146,7 @@ int CEF_CALLBACK command_line_has_switch(struct _cef_command_line_t* self, } cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( - struct _cef_command_line_t* self, const cef_string_t* name) -{ + struct _cef_command_line_t* self, const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -175,8 +166,7 @@ cef_string_userfree_t CEF_CALLBACK command_line_get_switch_value( } void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, - cef_string_map_t switches) -{ + cef_string_map_t switches) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -188,7 +178,7 @@ void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, return; // Translate param: switches; type: string_map_single_byref - std::map switchesMap; + std::map switchesMap; transfer_string_map_contents(switches, switchesMap); // Execute @@ -201,8 +191,7 @@ void CEF_CALLBACK command_line_get_switches(struct _cef_command_line_t* self, } void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, - const cef_string_t* name) -{ + const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -220,8 +209,7 @@ void CEF_CALLBACK command_line_append_switch(struct _cef_command_line_t* self, void CEF_CALLBACK command_line_append_switch_with_value( struct _cef_command_line_t* self, const cef_string_t* name, - const cef_string_t* value) -{ + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -242,8 +230,7 @@ void CEF_CALLBACK command_line_append_switch_with_value( CefString(value)); } -int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) -{ +int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -258,8 +245,7 @@ int CEF_CALLBACK command_line_has_arguments(struct _cef_command_line_t* self) } void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, - cef_string_list_t arguments) -{ + cef_string_list_t arguments) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -284,8 +270,7 @@ void CEF_CALLBACK command_line_get_arguments(struct _cef_command_line_t* self, } void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, - const cef_string_t* argument) -{ + const cef_string_t* argument) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -305,8 +290,7 @@ void CEF_CALLBACK command_line_append_argument(struct _cef_command_line_t* self, // CONSTRUCTOR - Do not edit by hand. CefCommandLineCppToC::CefCommandLineCppToC(CefCommandLine* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.init_from_argv = command_line_init_from_argv; struct_.struct_.init_from_string = command_line_init_from_string; struct_.struct_.get_command_line_string = diff --git a/libcef_dll/cpptoc/command_line_cpptoc.h b/libcef_dll/cpptoc/command_line_cpptoc.h index 6d8088595..1d98acd79 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.h +++ b/libcef_dll/cpptoc/command_line_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _COMMANDLINE_CPPTOC_H -#define _COMMANDLINE_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_command_line.h" #include "include/capi/cef_command_line_capi.h" @@ -24,13 +25,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefCommandLineCppToC - : public CefCppToC -{ -public: - CefCommandLineCppToC(CefCommandLine* cls); + : public CefCppToC { + public: + explicit CefCommandLineCppToC(CefCommandLine* cls); virtual ~CefCommandLineCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _COMMANDLINE_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/content_filter_cpptoc.cc b/libcef_dll/cpptoc/content_filter_cpptoc.cc index da2b03d86..1284f3ad3 100644 --- a/libcef_dll/cpptoc/content_filter_cpptoc.cc +++ b/libcef_dll/cpptoc/content_filter_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ void CEF_CALLBACK content_filter_process_data( struct _cef_content_filter_t* self, const void* data, int data_size, - struct _cef_stream_reader_t** substitute_data) -{ + struct _cef_stream_reader_t** substitute_data) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -59,8 +58,7 @@ void CEF_CALLBACK content_filter_process_data( } void CEF_CALLBACK content_filter_drain(struct _cef_content_filter_t* self, - struct _cef_stream_reader_t** remainder) -{ + struct _cef_stream_reader_t** remainder) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +96,7 @@ void CEF_CALLBACK content_filter_drain(struct _cef_content_filter_t* self, CefContentFilterCppToC::CefContentFilterCppToC(CefContentFilter* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.process_data = content_filter_process_data; struct_.struct_.drain = content_filter_drain; } diff --git a/libcef_dll/cpptoc/content_filter_cpptoc.h b/libcef_dll/cpptoc/content_filter_cpptoc.h index 91c391b67..2fb8fe7db 100644 --- a/libcef_dll/cpptoc/content_filter_cpptoc.h +++ b/libcef_dll/cpptoc/content_filter_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _CONTENTFILTER_CPPTOC_H -#define _CONTENTFILTER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_CONTENT_FILTER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_CONTENT_FILTER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_content_filter.h" #include "include/capi/cef_content_filter_capi.h" @@ -27,13 +28,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefContentFilterCppToC : public CefCppToC -{ -public: - CefContentFilterCppToC(CefContentFilter* cls); + cef_content_filter_t> { + public: + explicit CefContentFilterCppToC(CefContentFilter* cls); virtual ~CefContentFilterCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _CONTENTFILTER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_CONTENT_FILTER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc index 8e4c52890..fa61fe6c1 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, const struct _cef_cookie_t* cookie, int count, int total, - int* deleteCookie) -{ + int* deleteCookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -60,8 +59,7 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, CefCookieVisitorCppToC::CefCookieVisitorCppToC(CefCookieVisitor* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.visit = cookie_visitor_visit; } diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h index 99e60154b..6473a2309 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _COOKIEVISITOR_CPPTOC_H -#define _COOKIEVISITOR_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefCookieVisitorCppToC : public CefCppToC -{ -public: - CefCookieVisitorCppToC(CefCookieVisitor* cls); + cef_cookie_visitor_t> { + public: + explicit CefCookieVisitorCppToC(CefCookieVisitor* cls); virtual ~CefCookieVisitorCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _COOKIEVISITOR_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/cpptoc.h b/libcef_dll/cpptoc/cpptoc.h index 6e4065607..3449264f9 100644 --- a/libcef_dll/cpptoc/cpptoc.h +++ b/libcef_dll/cpptoc/cpptoc.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _CPPTOC_H -#define _CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_ +#pragma once #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" @@ -14,22 +15,19 @@ // implementation exists on this side of the DLL boundary but will have methods // called from the other side of the DLL boundary. template -class CefCppToC : public CefBase -{ -public: +class CefCppToC : public CefBase { + public: // Structure representation with pointer to the C++ class. - struct Struct - { + struct Struct { StructName struct_; - CefCppToC* class_; + CefCppToC* class_; }; - + // Use this method to retrieve the underlying class instance from our // own structure when the structure is passed as the required first // parameter of a C API function call. No explicit reference counting // is done in this case. - static CefRefPtr Get(StructName* s) - { + static CefRefPtr Get(StructName* s) { DCHECK(s); // Cast our structure to the wrapper structure type. @@ -37,11 +35,10 @@ public: // Return the underlying object instance. return wrapperStruct->class_->GetClass(); } - + // Use this method to create a wrapper structure for passing our class // instance to the other side. - static StructName* Wrap(CefRefPtr c) - { + static StructName* Wrap(CefRefPtr c) { if (!c.get()) return NULL; @@ -56,8 +53,7 @@ public: // Use this method to retrieve the underlying class instance when receiving // our wrapper structure back from the other side. - static CefRefPtr Unwrap(StructName* s) - { + static CefRefPtr Unwrap(StructName* s) { if (!s) return NULL; @@ -72,13 +68,12 @@ public: return objectPtr; } - CefCppToC(BaseName* cls) - : class_(cls) - { + explicit CefCppToC(BaseName* cls) + : class_(cls) { DCHECK(cls); struct_.class_ = this; - + // zero the underlying structure and set base members memset(&struct_.struct_, 0, sizeof(StructName)); struct_.struct_.base.size = sizeof(StructName); @@ -90,8 +85,7 @@ public: CefAtomicIncrement(&DebugObjCt); #endif } - virtual ~CefCppToC() - { + virtual ~CefCppToC() { #ifndef NDEBUG CefAtomicDecrement(&DebugObjCt); #endif @@ -106,13 +100,11 @@ public: // CefBase methods increment/decrement reference counts on both this object // and the underlying wrapper class. - int AddRef() - { + int AddRef() { UnderlyingAddRef(); return refct_.AddRef(); } - int Release() - { + int Release() { UnderlyingRelease(); int retval = refct_.Release(); if (retval == 0) @@ -128,44 +120,41 @@ public: #ifndef NDEBUG // Simple tracking of allocated objects. - static long DebugObjCt; + static long DebugObjCt; // NOLINT(runtime/int) #endif -private: - static int CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) - { + private: + static int CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) { DCHECK(base); - if(!base) + if (!base) return 0; Struct* impl = reinterpret_cast(base); return impl->class_->AddRef(); } - static int CEF_CALLBACK struct_release(struct _cef_base_t* base) - { + static int CEF_CALLBACK struct_release(struct _cef_base_t* base) { DCHECK(base); - if(!base) + if (!base) return 0; Struct* impl = reinterpret_cast(base); return impl->class_->Release(); } - static int CEF_CALLBACK struct_get_refct(struct _cef_base_t* base) - { + static int CEF_CALLBACK struct_get_refct(struct _cef_base_t* base) { DCHECK(base); - if(!base) + if (!base) return 0; Struct* impl = reinterpret_cast(base); return impl->class_->GetRefCt(); } -protected: + protected: CefRefCount refct_; Struct struct_; BaseName* class_; }; -#endif // _CPPTOC_H +#endif // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc index 7847e6227..5b6f6ef51 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ void CEF_CALLBACK display_handler_on_nav_state_change( struct _cef_display_handler_t* self, cef_browser_t* browser, int canGoBack, - int canGoForward) -{ + int canGoForward) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -40,8 +39,7 @@ void CEF_CALLBACK display_handler_on_nav_state_change( void CEF_CALLBACK display_handler_on_address_change( struct _cef_display_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, const cef_string_t* url) -{ + struct _cef_frame_t* frame, const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -69,8 +67,7 @@ void CEF_CALLBACK display_handler_on_address_change( void CEF_CALLBACK display_handler_on_contents_size_change( struct _cef_display_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, int width, int height) -{ + struct _cef_frame_t* frame, int width, int height) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,8 +92,7 @@ void CEF_CALLBACK display_handler_on_contents_size_change( void CEF_CALLBACK display_handler_on_title_change( struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* title) -{ + const cef_string_t* title) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,8 +111,7 @@ void CEF_CALLBACK display_handler_on_title_change( } int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, - cef_browser_t* browser, cef_string_t* text) -{ + cef_browser_t* browser, cef_string_t* text) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -142,8 +137,7 @@ int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, void CEF_CALLBACK display_handler_on_status_message( struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* value, enum cef_handler_statustype_t type) -{ + const cef_string_t* value, enum cef_handler_statustype_t type) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -164,8 +158,7 @@ void CEF_CALLBACK display_handler_on_status_message( int CEF_CALLBACK display_handler_on_console_message( struct _cef_display_handler_t* self, cef_browser_t* browser, - const cef_string_t* message, const cef_string_t* source, int line) -{ + const cef_string_t* message, const cef_string_t* source, int line) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -193,8 +186,7 @@ int CEF_CALLBACK display_handler_on_console_message( CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls) : CefCppToC(cls) -{ + cef_display_handler_t>(cls) { struct_.struct_.on_nav_state_change = display_handler_on_nav_state_change; struct_.struct_.on_address_change = display_handler_on_address_change; struct_.struct_.on_contents_size_change = diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.h b/libcef_dll/cpptoc/display_handler_cpptoc.h index e4b033af9..6fef44eb2 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.h +++ b/libcef_dll/cpptoc/display_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DISPLAYHANDLER_CPPTOC_H -#define _DISPLAYHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_display_handler.h" #include "include/capi/cef_display_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefDisplayHandlerCppToC : public CefCppToC -{ -public: - CefDisplayHandlerCppToC(CefDisplayHandler* cls); + cef_display_handler_t> { + public: + explicit CefDisplayHandlerCppToC(CefDisplayHandler* cls); virtual ~CefDisplayHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _DISPLAYHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.cc b/libcef_dll/cpptoc/domdocument_cpptoc.cc index 0ed630812..403f8d812 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.cc +++ b/libcef_dll/cpptoc/domdocument_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. enum cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +32,7 @@ enum cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -50,8 +48,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document( } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -66,8 +63,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body( } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -82,8 +78,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head( } cef_string_userfree_t CEF_CALLBACK domdocument_get_title( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +93,7 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_title( } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( - struct _cef_domdocument_t* self, const cef_string_t* id) -{ + struct _cef_domdocument_t* self, const cef_string_t* id) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -120,8 +114,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id( } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -136,8 +129,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node( return CefDOMNodeCppToC::Wrap(_retval); } -int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) -{ +int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -152,8 +144,7 @@ int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_start_node( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -169,8 +160,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_start_node( } int CEF_CALLBACK domdocument_get_selection_start_offset( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -185,8 +175,7 @@ int CEF_CALLBACK domdocument_get_selection_start_offset( } struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_end_node( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -202,8 +191,7 @@ struct _cef_domnode_t* CEF_CALLBACK domdocument_get_selection_end_node( } int CEF_CALLBACK domdocument_get_selection_end_offset( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -218,8 +206,7 @@ int CEF_CALLBACK domdocument_get_selection_end_offset( } cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -234,8 +221,7 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup( } cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -250,8 +236,7 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text( } cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( - struct _cef_domdocument_t* self) -{ + struct _cef_domdocument_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -266,8 +251,7 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url( } cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( - struct _cef_domdocument_t* self, const cef_string_t* partialURL) -{ + struct _cef_domdocument_t* self, const cef_string_t* partialURL) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -290,8 +274,7 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( // CONSTRUCTOR - Do not edit by hand. CefDOMDocumentCppToC::CefDOMDocumentCppToC(CefDOMDocument* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_type = domdocument_get_type; struct_.struct_.get_document = domdocument_get_document; struct_.struct_.get_body = domdocument_get_body; diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.h b/libcef_dll/cpptoc/domdocument_cpptoc.h index ccef3dd5a..a35fcdd7a 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.h +++ b/libcef_dll/cpptoc/domdocument_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMDOCUMENT_CPPTOC_H -#define _DOMDOCUMENT_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,13 +25,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDOMDocumentCppToC - : public CefCppToC -{ -public: - CefDOMDocumentCppToC(CefDOMDocument* cls); + : public CefCppToC { + public: + explicit CefDOMDocumentCppToC(CefDOMDocument* cls); virtual ~CefDOMDocumentCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _DOMDOCUMENT_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/domevent_cpptoc.cc b/libcef_dll/cpptoc/domevent_cpptoc.cc index 90c00d965..051898cab 100644 --- a/libcef_dll/cpptoc/domevent_cpptoc.cc +++ b/libcef_dll/cpptoc/domevent_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK domevent_get_type( - struct _cef_domevent_t* self) -{ + struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -34,8 +33,7 @@ cef_string_userfree_t CEF_CALLBACK domevent_get_type( } enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category( - struct _cef_domevent_t* self) -{ + struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,8 +49,7 @@ enum cef_dom_event_category_t CEF_CALLBACK domevent_get_category( } enum cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase( - struct _cef_domevent_t* self) -{ + struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -66,8 +63,7 @@ enum cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase( return _retval; } -int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) -{ +int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,8 +77,7 @@ int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) return _retval; } -int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) -{ +int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -97,8 +92,7 @@ int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) } cef_domdocument_t* CEF_CALLBACK domevent_get_document( - struct _cef_domevent_t* self) -{ + struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -113,8 +107,7 @@ cef_domdocument_t* CEF_CALLBACK domevent_get_document( return CefDOMDocumentCppToC::Wrap(_retval); } -cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) -{ +cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -129,8 +122,7 @@ cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) } cef_domnode_t* CEF_CALLBACK domevent_get_current_target( - struct _cef_domevent_t* self) -{ + struct _cef_domevent_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -149,8 +141,7 @@ cef_domnode_t* CEF_CALLBACK domevent_get_current_target( // CONSTRUCTOR - Do not edit by hand. CefDOMEventCppToC::CefDOMEventCppToC(CefDOMEvent* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_type = domevent_get_type; struct_.struct_.get_category = domevent_get_category; struct_.struct_.get_phase = domevent_get_phase; diff --git a/libcef_dll/cpptoc/domevent_cpptoc.h b/libcef_dll/cpptoc/domevent_cpptoc.h index 65b148427..aec1540ec 100644 --- a/libcef_dll/cpptoc/domevent_cpptoc.h +++ b/libcef_dll/cpptoc/domevent_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMEVENT_CPPTOC_H -#define _DOMEVENT_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDOMEventCppToC - : public CefCppToC -{ -public: - CefDOMEventCppToC(CefDOMEvent* cls); + : public CefCppToC { + public: + explicit CefDOMEventCppToC(CefDOMEvent* cls); virtual ~CefDOMEventCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _DOMEVENT_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/domevent_listener_cpptoc.cc b/libcef_dll/cpptoc/domevent_listener_cpptoc.cc index 887e32f7f..59e22c653 100644 --- a/libcef_dll/cpptoc/domevent_listener_cpptoc.cc +++ b/libcef_dll/cpptoc/domevent_listener_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK domevent_listener_handle_event( - struct _cef_domevent_listener_t* self, cef_domevent_t* event) -{ + struct _cef_domevent_listener_t* self, cef_domevent_t* event) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -39,8 +38,7 @@ void CEF_CALLBACK domevent_listener_handle_event( CefDOMEventListenerCppToC::CefDOMEventListenerCppToC(CefDOMEventListener* cls) : CefCppToC(cls) -{ + cef_domevent_listener_t>(cls) { struct_.struct_.handle_event = domevent_listener_handle_event; } diff --git a/libcef_dll/cpptoc/domevent_listener_cpptoc.h b/libcef_dll/cpptoc/domevent_listener_cpptoc.h index 742130a87..562882f3e 100644 --- a/libcef_dll/cpptoc/domevent_listener_cpptoc.h +++ b/libcef_dll/cpptoc/domevent_listener_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMEVENTLISTENER_CPPTOC_H -#define _DOMEVENTLISTENER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_LISTENER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_LISTENER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefDOMEventListenerCppToC : public CefCppToC -{ -public: - CefDOMEventListenerCppToC(CefDOMEventListener* cls); + cef_domevent_listener_t> { + public: + explicit CefDOMEventListenerCppToC(CefDOMEventListener* cls); virtual ~CefDOMEventListenerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _DOMEVENTLISTENER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_LISTENER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/domnode_cpptoc.cc b/libcef_dll/cpptoc/domnode_cpptoc.cc index d09e6639c..209ae7a82 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.cc +++ b/libcef_dll/cpptoc/domnode_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. enum cef_dom_node_type_t CEF_CALLBACK domnode_get_type( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -34,8 +33,7 @@ enum cef_dom_node_type_t CEF_CALLBACK domnode_get_type( return _retval; } -int CEF_CALLBACK domnode_is_text(struct _cef_domnode_t* self) -{ +int CEF_CALLBACK domnode_is_text(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -49,8 +47,7 @@ int CEF_CALLBACK domnode_is_text(struct _cef_domnode_t* self) return _retval; } -int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) -{ +int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -64,8 +61,7 @@ int CEF_CALLBACK domnode_is_element(struct _cef_domnode_t* self) return _retval; } -int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) -{ +int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -80,8 +76,7 @@ int CEF_CALLBACK domnode_is_form_control_element(struct _cef_domnode_t* self) } cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -96,8 +91,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_form_control_element_type( } int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, - struct _cef_domnode_t* that) -{ + struct _cef_domnode_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -116,8 +110,8 @@ int CEF_CALLBACK domnode_is_same(struct _cef_domnode_t* self, return _retval; } -cef_string_userfree_t CEF_CALLBACK domnode_get_name(struct _cef_domnode_t* self) -{ +cef_string_userfree_t CEF_CALLBACK domnode_get_name( + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -132,8 +126,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_name(struct _cef_domnode_t* self) } cef_string_userfree_t CEF_CALLBACK domnode_get_value( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -148,8 +141,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_value( } int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, - const cef_string_t* value) -{ + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -169,8 +161,7 @@ int CEF_CALLBACK domnode_set_value(struct _cef_domnode_t* self, } cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -185,8 +176,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_as_markup( } cef_domdocument_t* CEF_CALLBACK domnode_get_document( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -202,8 +192,7 @@ cef_domdocument_t* CEF_CALLBACK domnode_get_document( } struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -218,8 +207,7 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_parent( } struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -235,8 +223,7 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_previous_sibling( } struct _cef_domnode_t* CEF_CALLBACK domnode_get_next_sibling( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -250,8 +237,7 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_next_sibling( return CefDOMNodeCppToC::Wrap(_retval); } -int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) -{ +int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -266,8 +252,7 @@ int CEF_CALLBACK domnode_has_children(struct _cef_domnode_t* self) } struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -282,8 +267,7 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_first_child( } struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -299,8 +283,7 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child( void CEF_CALLBACK domnode_add_event_listener(struct _cef_domnode_t* self, const cef_string_t* eventType, struct _cef_domevent_listener_t* listener, - int useCapture) -{ + int useCapture) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -323,8 +306,7 @@ void CEF_CALLBACK domnode_add_event_listener(struct _cef_domnode_t* self, } cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -338,8 +320,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name( return _retval.DetachToUserFree(); } -int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) -{ +int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -354,8 +335,7 @@ int CEF_CALLBACK domnode_has_element_attributes(struct _cef_domnode_t* self) } int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, - const cef_string_t* attrName) -{ + const cef_string_t* attrName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -375,8 +355,7 @@ int CEF_CALLBACK domnode_has_element_attribute(struct _cef_domnode_t* self, } cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( - struct _cef_domnode_t* self, const cef_string_t* attrName) -{ + struct _cef_domnode_t* self, const cef_string_t* attrName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -396,8 +375,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_attribute( } void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, - cef_string_map_t attrMap) -{ + cef_string_map_t attrMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -409,7 +387,7 @@ void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, return; // Translate param: attrMap; type: string_map_single_byref - std::map attrMapMap; + std::map attrMapMap; transfer_string_map_contents(attrMap, attrMapMap); // Execute @@ -422,8 +400,7 @@ void CEF_CALLBACK domnode_get_element_attributes(struct _cef_domnode_t* self, } int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, - const cef_string_t* attrName, const cef_string_t* value) -{ + const cef_string_t* attrName, const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -448,8 +425,7 @@ int CEF_CALLBACK domnode_set_element_attribute(struct _cef_domnode_t* self, } cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( - struct _cef_domnode_t* self) -{ + struct _cef_domnode_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -467,8 +443,7 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( // CONSTRUCTOR - Do not edit by hand. CefDOMNodeCppToC::CefDOMNodeCppToC(CefDOMNode* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_type = domnode_get_type; struct_.struct_.is_text = domnode_is_text; struct_.struct_.is_element = domnode_is_element; diff --git a/libcef_dll/cpptoc/domnode_cpptoc.h b/libcef_dll/cpptoc/domnode_cpptoc.h index 8690791fc..1da9af779 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.h +++ b/libcef_dll/cpptoc/domnode_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMNODE_CPPTOC_H -#define _DOMNODE_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDOMNodeCppToC - : public CefCppToC -{ -public: - CefDOMNodeCppToC(CefDOMNode* cls); + : public CefCppToC { + public: + explicit CefDOMNodeCppToC(CefDOMNode* cls); virtual ~CefDOMNodeCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _DOMNODE_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/libcef_dll/cpptoc/domvisitor_cpptoc.cc index f1342f795..aefbe1c92 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.cc +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, - struct _cef_domdocument_t* document) -{ + struct _cef_domdocument_t* document) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -38,8 +37,7 @@ void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, // CONSTRUCTOR - Do not edit by hand. CefDOMVisitorCppToC::CefDOMVisitorCppToC(CefDOMVisitor* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.visit = domvisitor_visit; } diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.h b/libcef_dll/cpptoc/domvisitor_cpptoc.h index 398826d7c..0f09b0b60 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.h +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMVISITOR_CPPTOC_H -#define _DOMVISITOR_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDOMVisitorCppToC - : public CefCppToC -{ -public: - CefDOMVisitorCppToC(CefDOMVisitor* cls); + : public CefCppToC { + public: + explicit CefDOMVisitorCppToC(CefDOMVisitor* cls); virtual ~CefDOMVisitorCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _DOMVISITOR_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.cc b/libcef_dll/cpptoc/download_handler_cpptoc.cc index 023e508d2..a868039ec 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/download_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK download_handler_received_data( - struct _cef_download_handler_t* self, void* data, int data_size) -{ + struct _cef_download_handler_t* self, void* data, int data_size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -38,8 +37,7 @@ int CEF_CALLBACK download_handler_received_data( } void CEF_CALLBACK download_handler_complete( - struct _cef_download_handler_t* self) -{ + struct _cef_download_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -55,8 +53,7 @@ void CEF_CALLBACK download_handler_complete( CefDownloadHandlerCppToC::CefDownloadHandlerCppToC(CefDownloadHandler* cls) : CefCppToC(cls) -{ + cef_download_handler_t>(cls) { struct_.struct_.received_data = download_handler_received_data; struct_.struct_.complete = download_handler_complete; } diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.h b/libcef_dll/cpptoc/download_handler_cpptoc.h index c837750e9..f659d613d 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.h +++ b/libcef_dll/cpptoc/download_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOWNLOADHANDLER_CPPTOC_H -#define _DOWNLOADHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefDownloadHandlerCppToC : public CefCppToC -{ -public: - CefDownloadHandlerCppToC(CefDownloadHandler* cls); + cef_download_handler_t> { + public: + explicit CefDownloadHandlerCppToC(CefDownloadHandler* cls); virtual ~CefDownloadHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _DOWNLOADHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.cc b/libcef_dll/cpptoc/drag_data_cpptoc.cc index 107536ea3..05f85d089 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_data_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK drag_data_is_link(struct _cef_drag_data_t* self) -{ +int CEF_CALLBACK drag_data_is_link(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,8 +30,7 @@ int CEF_CALLBACK drag_data_is_link(struct _cef_drag_data_t* self) return _retval; } -int CEF_CALLBACK drag_data_is_fragment(struct _cef_drag_data_t* self) -{ +int CEF_CALLBACK drag_data_is_fragment(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -46,8 +44,7 @@ int CEF_CALLBACK drag_data_is_fragment(struct _cef_drag_data_t* self) return _retval; } -int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) -{ +int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -62,8 +59,7 @@ int CEF_CALLBACK drag_data_is_file(struct _cef_drag_data_t* self) } cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -78,8 +74,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_url( } cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -94,8 +89,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_title( } cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -110,8 +104,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_link_metadata( } cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -126,8 +119,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_text( } cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -142,8 +134,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_html( } cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -158,8 +149,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_fragment_base_url( } cef_string_userfree_t CEF_CALLBACK drag_data_get_file_extension( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -174,8 +164,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_file_extension( } cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( - struct _cef_drag_data_t* self) -{ + struct _cef_drag_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -190,8 +179,7 @@ cef_string_userfree_t CEF_CALLBACK drag_data_get_file_name( } int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, - cef_string_list_t names) -{ + cef_string_list_t names) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -222,8 +210,7 @@ int CEF_CALLBACK drag_data_get_file_names(struct _cef_drag_data_t* self, // CONSTRUCTOR - Do not edit by hand. CefDragDataCppToC::CefDragDataCppToC(CefDragData* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.is_link = drag_data_is_link; struct_.struct_.is_fragment = drag_data_is_fragment; struct_.struct_.is_file = drag_data_is_file; diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.h b/libcef_dll/cpptoc/drag_data_cpptoc.h index dc9aa5d86..9e880a41e 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.h +++ b/libcef_dll/cpptoc/drag_data_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DRAGDATA_CPPTOC_H -#define _DRAGDATA_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_drag_data.h" #include "include/capi/cef_drag_data_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefDragDataCppToC - : public CefCppToC -{ -public: - CefDragDataCppToC(CefDragData* cls); + : public CefCppToC { + public: + explicit CefDragDataCppToC(CefDragData* cls); virtual ~CefDragDataCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _DRAGDATA_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/libcef_dll/cpptoc/drag_handler_cpptoc.cc index af7ce893f..927caeeb5 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ int CEF_CALLBACK drag_handler_on_drag_start(struct _cef_drag_handler_t* self, cef_browser_t* browser, cef_drag_data_t* dragData, - enum cef_drag_operations_mask_t mask) -{ + enum cef_drag_operations_mask_t mask) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +46,7 @@ int CEF_CALLBACK drag_handler_on_drag_start(struct _cef_drag_handler_t* self, int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, cef_browser_t* browser, cef_drag_data_t* dragData, - enum cef_drag_operations_mask_t mask) -{ + enum cef_drag_operations_mask_t mask) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -77,8 +75,7 @@ int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, // CONSTRUCTOR - Do not edit by hand. CefDragHandlerCppToC::CefDragHandlerCppToC(CefDragHandler* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.on_drag_start = drag_handler_on_drag_start; struct_.struct_.on_drag_enter = drag_handler_on_drag_enter; } diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.h b/libcef_dll/cpptoc/drag_handler_cpptoc.h index 6a4ef4770..06c244c08 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.h +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DRAGHANDLER_CPPTOC_H -#define _DRAGHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_drag_handler.h" #include "include/capi/cef_drag_handler_capi.h" @@ -26,13 +27,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefDragHandlerCppToC - : public CefCppToC -{ -public: - CefDragHandlerCppToC(CefDragHandler* cls); + : public CefCppToC { + public: + explicit CefDragHandlerCppToC(CefDragHandler* cls); virtual ~CefDragHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _DRAGHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.cc b/libcef_dll/cpptoc/find_handler_cpptoc.cc index 76c885106..e96273377 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/find_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,8 @@ void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, cef_browser_t* browser, int identifier, int count, - const cef_rect_t* selectionRect, int activeMatchOrdinal, int finalUpdate) -{ + const cef_rect_t* selectionRect, int activeMatchOrdinal, + int finalUpdate) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,8 +51,7 @@ void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, // CONSTRUCTOR - Do not edit by hand. CefFindHandlerCppToC::CefFindHandlerCppToC(CefFindHandler* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.on_find_result = find_handler_on_find_result; } diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.h b/libcef_dll/cpptoc/find_handler_cpptoc.h index 33f39925c..27dcc6ec5 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.h +++ b/libcef_dll/cpptoc/find_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _FINDHANDLER_CPPTOC_H -#define _FINDHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_find_handler.h" #include "include/capi/cef_find_handler_capi.h" @@ -26,13 +27,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefFindHandlerCppToC - : public CefCppToC -{ -public: - CefFindHandlerCppToC(CefFindHandler* cls); + : public CefCppToC { + public: + explicit CefFindHandlerCppToC(CefFindHandler* cls); virtual ~CefFindHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _FINDHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/libcef_dll/cpptoc/focus_handler_cpptoc.cc index 3c7e5517b..bffe00bb5 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, - cef_browser_t* browser, int next) -{ + cef_browser_t* browser, int next) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -38,8 +37,7 @@ void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, } int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, - cef_browser_t* browser, enum cef_handler_focus_source_t source) -{ + cef_browser_t* browser, enum cef_handler_focus_source_t source) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -61,8 +59,7 @@ int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, void CEF_CALLBACK focus_handler_on_focused_node_changed( struct _cef_focus_handler_t* self, cef_browser_t* browser, - struct _cef_frame_t* frame, cef_domnode_t* node) -{ + struct _cef_frame_t* frame, cef_domnode_t* node) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -86,8 +83,7 @@ void CEF_CALLBACK focus_handler_on_focused_node_changed( CefFocusHandlerCppToC::CefFocusHandlerCppToC(CefFocusHandler* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.on_take_focus = focus_handler_on_take_focus; struct_.struct_.on_set_focus = focus_handler_on_set_focus; struct_.struct_.on_focused_node_changed = diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.h b/libcef_dll/cpptoc/focus_handler_cpptoc.h index e429099ba..79a65736b 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.h +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _FOCUSHANDLER_CPPTOC_H -#define _FOCUSHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_focus_handler.h" #include "include/capi/cef_focus_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefFocusHandlerCppToC : public CefCppToC -{ -public: - CefFocusHandlerCppToC(CefFocusHandler* cls); + cef_focus_handler_t> { + public: + explicit CefFocusHandlerCppToC(CefFocusHandler* cls); virtual ~CefFocusHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _FOCUSHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc index bd117440e..aef2f2e24 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.cc +++ b/libcef_dll/cpptoc/frame_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK frame_undo(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_undo(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,8 +31,7 @@ void CEF_CALLBACK frame_undo(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Undo(); } -void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -44,8 +42,7 @@ void CEF_CALLBACK frame_redo(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Redo(); } -void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,8 +53,7 @@ void CEF_CALLBACK frame_cut(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Cut(); } -void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,8 +64,7 @@ void CEF_CALLBACK frame_copy(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Copy(); } -void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -80,8 +75,7 @@ void CEF_CALLBACK frame_paste(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Paste(); } -void CEF_CALLBACK frame_del(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_del(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -92,8 +86,7 @@ void CEF_CALLBACK frame_del(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Delete(); } -void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -104,8 +97,7 @@ void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->SelectAll(); } -void CEF_CALLBACK frame_print(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_print(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -116,8 +108,7 @@ void CEF_CALLBACK frame_print(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->Print(); } -void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) -{ +void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,8 +119,7 @@ void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self) CefFrameCppToC::Get(self)->ViewSource(); } -cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self) -{ +cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -143,8 +133,7 @@ cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } -cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) -{ +cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -159,8 +148,7 @@ cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self) } void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, - struct _cef_request_t* request) -{ + struct _cef_request_t* request) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -177,8 +165,7 @@ void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self, } void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, - const cef_string_t* url) -{ + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -195,16 +182,15 @@ void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self, } void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, - const cef_string_t* string, const cef_string_t* url) -{ + const cef_string_t* string_val, const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return; - // Verify param: string; type: string_byref_const - DCHECK(string); - if (!string) + // Verify param: string_val; type: string_byref_const + DCHECK(string_val); + if (!string_val) return; // Verify param: url; type: string_byref_const DCHECK(url); @@ -213,13 +199,12 @@ void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self, // Execute CefFrameCppToC::Get(self)->LoadString( - CefString(string), + CefString(string_val), CefString(url)); } void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self, - struct _cef_stream_reader_t* stream, const cef_string_t* url) -{ + struct _cef_stream_reader_t* stream, const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -241,8 +226,8 @@ void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self, } void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, - const cef_string_t* jsCode, const cef_string_t* scriptUrl, int startLine) -{ + const cef_string_t* jsCode, const cef_string_t* scriptUrl, + int startLine) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -261,8 +246,7 @@ void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self, startLine); } -int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) -{ +int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -276,8 +260,7 @@ int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self) return _retval; } -int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) -{ +int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -291,8 +274,7 @@ int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self) return _retval; } -cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) -{ +cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -306,8 +288,7 @@ cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } -long long CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) -{ +int64 CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -315,14 +296,13 @@ long long CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) return 0; // Execute - long long _retval = CefFrameCppToC::Get(self)->GetIdentifier(); + int64 _retval = CefFrameCppToC::Get(self)->GetIdentifier(); // Return type: simple return _retval; } -struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) -{ +struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -336,8 +316,7 @@ struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) return CefFrameCppToC::Wrap(_retval); } -cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) -{ +cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -351,8 +330,7 @@ cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self) return _retval.DetachToUserFree(); } -cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) -{ +cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -367,8 +345,7 @@ cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self) } void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, - cef_domvisitor_t* visitor) -{ + cef_domvisitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -385,8 +362,7 @@ void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, } struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( - struct _cef_frame_t* self) -{ + struct _cef_frame_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -404,8 +380,7 @@ struct _cef_v8context_t* CEF_CALLBACK frame_get_v8context( // CONSTRUCTOR - Do not edit by hand. CefFrameCppToC::CefFrameCppToC(CefFrame* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.undo = frame_undo; struct_.struct_.redo = frame_redo; struct_.struct_.cut = frame_cut; diff --git a/libcef_dll/cpptoc/frame_cpptoc.h b/libcef_dll/cpptoc/frame_cpptoc.h index dabc35e91..acbb97e53 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.h +++ b/libcef_dll/cpptoc/frame_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _FRAME_CPPTOC_H -#define _FRAME_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_frame.h" #include "include/capi/cef_frame_capi.h" @@ -34,13 +35,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefFrameCppToC - : public CefCppToC -{ -public: - CefFrameCppToC(CefFrame* cls); + : public CefCppToC { + public: + explicit CefFrameCppToC(CefFrame* cls); virtual ~CefFrameCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _FRAME_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc index 3f5b120b5..d87d94d7e 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ int CEF_CALLBACK jsdialog_handler_on_jsalert( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* message) -{ + cef_frame_t* frame, const cef_string_t* message) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,8 +50,7 @@ int CEF_CALLBACK jsdialog_handler_on_jsalert( int CEF_CALLBACK jsdialog_handler_on_jsconfirm( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* message, int* retval) -{ + cef_frame_t* frame, const cef_string_t* message, int* retval) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -96,8 +94,7 @@ int CEF_CALLBACK jsdialog_handler_on_jsconfirm( int CEF_CALLBACK jsdialog_handler_on_jsprompt( struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const cef_string_t* message, - const cef_string_t* defaultValue, int* retval, cef_string_t* result) -{ + const cef_string_t* defaultValue, int* retval, cef_string_t* result) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -155,8 +152,7 @@ int CEF_CALLBACK jsdialog_handler_on_jsprompt( CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC(CefJSDialogHandler* cls) : CefCppToC(cls) -{ + cef_jsdialog_handler_t>(cls) { struct_.struct_.on_jsalert = jsdialog_handler_on_jsalert; struct_.struct_.on_jsconfirm = jsdialog_handler_on_jsconfirm; struct_.struct_.on_jsprompt = jsdialog_handler_on_jsprompt; diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h index 424e0e9c1..96b16f871 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _JSDIALOGHANDLER_CPPTOC_H -#define _JSDIALOGHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_jsdialog_handler.h" #include "include/capi/cef_jsdialog_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefJSDialogHandlerCppToC : public CefCppToC -{ -public: - CefJSDialogHandlerCppToC(CefJSDialogHandler* cls); + cef_jsdialog_handler_t> { + public: + explicit CefJSDialogHandlerCppToC(CefJSDialogHandler* cls); virtual ~CefJSDialogHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _JSDIALOGHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc index 6cb3a2b19..dbced2bed 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ int CEF_CALLBACK keyboard_handler_on_key_event( struct _cef_keyboard_handler_t* self, cef_browser_t* browser, enum cef_handler_keyevent_type_t type, int code, int modifiers, - int isSystemKey, int isAfterJavaScript) -{ + int isSystemKey, int isAfterJavaScript) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -49,8 +48,7 @@ int CEF_CALLBACK keyboard_handler_on_key_event( CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC(CefKeyboardHandler* cls) : CefCppToC(cls) -{ + cef_keyboard_handler_t>(cls) { struct_.struct_.on_key_event = keyboard_handler_on_key_event; } diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h index 82e7f7608..7d46593eb 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _KEYBOARDHANDLER_CPPTOC_H -#define _KEYBOARDHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_keyboard_handler.h" #include "include/capi/cef_keyboard_handler_capi.h" @@ -27,13 +28,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefKeyboardHandlerCppToC : public CefCppToC -{ -public: - CefKeyboardHandlerCppToC(CefKeyboardHandler* cls); + cef_keyboard_handler_t> { + public: + explicit CefKeyboardHandlerCppToC(CefKeyboardHandler* cls); virtual ~CefKeyboardHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _KEYBOARDHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc index b161f2693..85b1e2708 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -21,8 +21,7 @@ int CEF_CALLBACK life_span_handler_on_before_popup( struct _cef_life_span_handler_t* self, cef_browser_t* parentBrowser, const struct _cef_popup_features_t* popupFeatures, cef_window_info_t* windowInfo, const cef_string_t* url, - cef_client_t** client, struct _cef_browser_settings_t* settings) -{ + cef_client_t** client, struct _cef_browser_settings_t* settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -99,8 +98,7 @@ int CEF_CALLBACK life_span_handler_on_before_popup( } void CEF_CALLBACK life_span_handler_on_after_created( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) -{ + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -117,8 +115,7 @@ void CEF_CALLBACK life_span_handler_on_after_created( } int CEF_CALLBACK life_span_handler_run_modal( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) -{ + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -138,8 +135,7 @@ int CEF_CALLBACK life_span_handler_run_modal( } int CEF_CALLBACK life_span_handler_do_close( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) -{ + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -159,8 +155,7 @@ int CEF_CALLBACK life_span_handler_do_close( } void CEF_CALLBACK life_span_handler_on_before_close( - struct _cef_life_span_handler_t* self, cef_browser_t* browser) -{ + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -181,8 +176,7 @@ void CEF_CALLBACK life_span_handler_on_before_close( CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls) : CefCppToC(cls) -{ + cef_life_span_handler_t>(cls) { struct_.struct_.on_before_popup = life_span_handler_on_before_popup; struct_.struct_.on_after_created = life_span_handler_on_after_created; struct_.struct_.run_modal = life_span_handler_run_modal; diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/libcef_dll/cpptoc/life_span_handler_cpptoc.h index 082fd1f38..88a8e379f 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.h +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _LIFESPANHANDLER_CPPTOC_H -#define _LIFESPANHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_life_span_handler.h" #include "include/capi/cef_life_span_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefLifeSpanHandlerCppToC : public CefCppToC -{ -public: - CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls); + cef_life_span_handler_t> { + public: + explicit CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls); virtual ~CefLifeSpanHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _LIFESPANHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.cc b/libcef_dll/cpptoc/load_handler_cpptoc.cc index dd7046903..14c31cfa3 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/load_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, - cef_browser_t* browser, cef_frame_t* frame) -{ + cef_browser_t* browser, cef_frame_t* frame) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -41,8 +40,7 @@ void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, } void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, - cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) -{ + cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -67,8 +65,7 @@ void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, int CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl, - cef_string_t* errorText) -{ + cef_string_t* errorText) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -110,8 +107,7 @@ int CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, // CONSTRUCTOR - Do not edit by hand. CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.on_load_start = load_handler_on_load_start; struct_.struct_.on_load_end = load_handler_on_load_end; struct_.struct_.on_load_error = load_handler_on_load_error; diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.h b/libcef_dll/cpptoc/load_handler_cpptoc.h index 883c07cd5..11244b2bb 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.h +++ b/libcef_dll/cpptoc/load_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _LOADHANDLER_CPPTOC_H -#define _LOADHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_load_handler.h" #include "include/capi/cef_load_handler_capi.h" @@ -28,13 +29,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefLoadHandlerCppToC - : public CefCppToC -{ -public: - CefLoadHandlerCppToC(CefLoadHandler* cls); + : public CefCppToC { + public: + explicit CefLoadHandlerCppToC(CefLoadHandler* cls); virtual ~CefLoadHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _LOADHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/menu_handler_cpptoc.cc b/libcef_dll/cpptoc/menu_handler_cpptoc.cc index 18871494a..d1c000f90 100644 --- a/libcef_dll/cpptoc/menu_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/menu_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK menu_handler_on_before_menu(struct _cef_menu_handler_t* self, - cef_browser_t* browser, const struct _cef_menu_info_t* menuInfo) -{ + cef_browser_t* browser, const struct _cef_menu_info_t* menuInfo) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,8 +47,7 @@ int CEF_CALLBACK menu_handler_on_before_menu(struct _cef_menu_handler_t* self, } void CEF_CALLBACK menu_handler_get_menu_label(struct _cef_menu_handler_t* self, - cef_browser_t* browser, enum cef_menu_id_t menuId, cef_string_t* label) -{ + cef_browser_t* browser, enum cef_menu_id_t menuId, cef_string_t* label) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -75,8 +73,7 @@ void CEF_CALLBACK menu_handler_get_menu_label(struct _cef_menu_handler_t* self, } int CEF_CALLBACK menu_handler_on_menu_action(struct _cef_menu_handler_t* self, - cef_browser_t* browser, enum cef_menu_id_t menuId) -{ + cef_browser_t* browser, enum cef_menu_id_t menuId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -100,8 +97,7 @@ int CEF_CALLBACK menu_handler_on_menu_action(struct _cef_menu_handler_t* self, // CONSTRUCTOR - Do not edit by hand. CefMenuHandlerCppToC::CefMenuHandlerCppToC(CefMenuHandler* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.on_before_menu = menu_handler_on_before_menu; struct_.struct_.get_menu_label = menu_handler_get_menu_label; struct_.struct_.on_menu_action = menu_handler_on_menu_action; diff --git a/libcef_dll/cpptoc/menu_handler_cpptoc.h b/libcef_dll/cpptoc/menu_handler_cpptoc.h index 1a0e7aa9c..d48064542 100644 --- a/libcef_dll/cpptoc/menu_handler_cpptoc.h +++ b/libcef_dll/cpptoc/menu_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _MENUHANDLER_CPPTOC_H -#define _MENUHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_MENU_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_MENU_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_menu_handler.h" #include "include/capi/cef_menu_handler_capi.h" @@ -26,13 +27,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefMenuHandlerCppToC - : public CefCppToC -{ -public: - CefMenuHandlerCppToC(CefMenuHandler* cls); + : public CefCppToC { + public: + explicit CefMenuHandlerCppToC(CefMenuHandler* cls); virtual ~CefMenuHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _MENUHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_MENU_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/permission_handler_cpptoc.cc b/libcef_dll/cpptoc/permission_handler_cpptoc.cc index b041b0d54..5558de8eb 100644 --- a/libcef_dll/cpptoc/permission_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/permission_handler_cpptoc.cc @@ -19,8 +19,7 @@ int CEF_CALLBACK permission_handler_on_before_script_extension_load( struct _cef_permission_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, const cef_string_t* extensionName) -{ + cef_frame_t* frame, const cef_string_t* extensionName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,8 +55,7 @@ int CEF_CALLBACK permission_handler_on_before_script_extension_load( CefPermissionHandlerCppToC::CefPermissionHandlerCppToC( CefPermissionHandler* cls) : CefCppToC(cls) -{ + cef_permission_handler_t>(cls) { struct_.struct_.on_before_script_extension_load = permission_handler_on_before_script_extension_load; } diff --git a/libcef_dll/cpptoc/permission_handler_cpptoc.h b/libcef_dll/cpptoc/permission_handler_cpptoc.h index d43d8655b..6c8d2f86d 100644 --- a/libcef_dll/cpptoc/permission_handler_cpptoc.h +++ b/libcef_dll/cpptoc/permission_handler_cpptoc.h @@ -10,12 +10,13 @@ // for more information. // -#ifndef _PERMISSIONHANDLER_CPPTOC_H -#define _PERMISSIONHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_PERMISSION_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_PERMISSION_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_permission_handler.h" #include "include/capi/cef_permission_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefPermissionHandlerCppToC : public CefCppToC -{ -public: - CefPermissionHandlerCppToC(CefPermissionHandler* cls); + cef_permission_handler_t> { + public: + explicit CefPermissionHandlerCppToC(CefPermissionHandler* cls); virtual ~CefPermissionHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _PERMISSIONHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_PERMISSION_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/post_data_cpptoc.cc b/libcef_dll/cpptoc/post_data_cpptoc.cc index b6bb74eca..add00ea77 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_post_data_t* cef_post_data_create() -{ +CEF_EXPORT cef_post_data_t* cef_post_data_create() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -30,8 +29,7 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() // MEMBER FUNCTIONS - Body may be edited by hand. -size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) -{ +size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -46,8 +44,7 @@ size_t CEF_CALLBACK post_data_get_element_count(struct _cef_post_data_t* self) } void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, - size_t* elementsCount, struct _cef_post_data_element_t** elements) -{ + size_t* elementsCount, struct _cef_post_data_element_t** elements) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -82,8 +79,7 @@ void CEF_CALLBACK post_data_get_elements(struct _cef_post_data_t* self, } int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, - struct _cef_post_data_element_t* element) -{ + struct _cef_post_data_element_t* element) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -103,8 +99,7 @@ int CEF_CALLBACK post_data_remove_element(struct _cef_post_data_t* self, } int CEF_CALLBACK post_data_add_element(struct _cef_post_data_t* self, - struct _cef_post_data_element_t* element) -{ + struct _cef_post_data_element_t* element) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,8 +118,7 @@ int CEF_CALLBACK post_data_add_element(struct _cef_post_data_t* self, return _retval; } -void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) -{ +void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +133,7 @@ void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) // CONSTRUCTOR - Do not edit by hand. CefPostDataCppToC::CefPostDataCppToC(CefPostData* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_element_count = post_data_get_element_count; struct_.struct_.get_elements = post_data_get_elements; struct_.struct_.remove_element = post_data_remove_element; diff --git a/libcef_dll/cpptoc/post_data_cpptoc.h b/libcef_dll/cpptoc/post_data_cpptoc.h index f174557c1..a97ebbecc 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _POSTDATA_CPPTOC_H -#define _POSTDATA_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_request.h" #include "include/capi/cef_request_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefPostDataCppToC - : public CefCppToC -{ -public: - CefPostDataCppToC(CefPostData* cls); + : public CefCppToC { + public: + explicit CefPostDataCppToC(CefPostData* cls); virtual ~CefPostDataCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _POSTDATA_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/libcef_dll/cpptoc/post_data_element_cpptoc.cc index 7e54052e2..cddf7c4a9 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() -{ +CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -31,8 +30,7 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK post_data_element_set_to_empty( - struct _cef_post_data_element_t* self) -{ + struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -44,8 +42,7 @@ void CEF_CALLBACK post_data_element_set_to_empty( } void CEF_CALLBACK post_data_element_set_to_file( - struct _cef_post_data_element_t* self, const cef_string_t* fileName) -{ + struct _cef_post_data_element_t* self, const cef_string_t* fileName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -62,8 +59,7 @@ void CEF_CALLBACK post_data_element_set_to_file( } void CEF_CALLBACK post_data_element_set_to_bytes( - struct _cef_post_data_element_t* self, size_t size, const void* bytes) -{ + struct _cef_post_data_element_t* self, size_t size, const void* bytes) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,8 +77,7 @@ void CEF_CALLBACK post_data_element_set_to_bytes( } enum cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( - struct _cef_post_data_element_t* self) -{ + struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +93,7 @@ enum cef_postdataelement_type_t CEF_CALLBACK post_data_element_get_type( } cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( - struct _cef_post_data_element_t* self) -{ + struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -114,8 +108,7 @@ cef_string_userfree_t CEF_CALLBACK post_data_element_get_file( } size_t CEF_CALLBACK post_data_element_get_bytes_count( - struct _cef_post_data_element_t* self) -{ + struct _cef_post_data_element_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -130,8 +123,7 @@ size_t CEF_CALLBACK post_data_element_get_bytes_count( } size_t CEF_CALLBACK post_data_element_get_bytes( - struct _cef_post_data_element_t* self, size_t size, void* bytes) -{ + struct _cef_post_data_element_t* self, size_t size, void* bytes) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -156,8 +148,7 @@ size_t CEF_CALLBACK post_data_element_get_bytes( CefPostDataElementCppToC::CefPostDataElementCppToC(CefPostDataElement* cls) : CefCppToC(cls) -{ + cef_post_data_element_t>(cls) { struct_.struct_.set_to_empty = post_data_element_set_to_empty; struct_.struct_.set_to_file = post_data_element_set_to_file; struct_.struct_.set_to_bytes = post_data_element_set_to_bytes; diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.h b/libcef_dll/cpptoc/post_data_element_cpptoc.h index cdbd97835..72d14e436 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _POSTDATAELEMENT_CPPTOC_H -#define _POSTDATAELEMENT_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_request.h" #include "include/capi/cef_request_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed DLL-side only. class CefPostDataElementCppToC : public CefCppToC -{ -public: - CefPostDataElementCppToC(CefPostDataElement* cls); + cef_post_data_element_t> { + public: + explicit CefPostDataElementCppToC(CefPostDataElement* cls); virtual ~CefPostDataElementCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _POSTDATAELEMENT_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.cc b/libcef_dll/cpptoc/print_handler_cpptoc.cc index 8a0c2acbc..d72e151ff 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/print_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ int CEF_CALLBACK print_handler_get_print_options( struct _cef_print_handler_t* self, cef_browser_t* browser, - struct _cef_print_options_t* printOptions) -{ + struct _cef_print_options_t* printOptions) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -59,8 +58,7 @@ int CEF_CALLBACK print_handler_get_print_header_footer( const cef_string_t* url, const cef_string_t* title, int currentPage, int maxPages, cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight, cef_string_t* bottomLeft, - cef_string_t* bottomCenter, cef_string_t* bottomRight) -{ + cef_string_t* bottomCenter, cef_string_t* bottomRight) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -153,8 +151,7 @@ int CEF_CALLBACK print_handler_get_print_header_footer( CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.get_print_options = print_handler_get_print_options; struct_.struct_.get_print_header_footer = print_handler_get_print_header_footer; diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.h b/libcef_dll/cpptoc/print_handler_cpptoc.h index 941a9839b..6dea3a479 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.h +++ b/libcef_dll/cpptoc/print_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _PRINTHANDLER_CPPTOC_H -#define _PRINTHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefPrintHandlerCppToC : public CefCppToC -{ -public: - CefPrintHandlerCppToC(CefPrintHandler* cls); + cef_print_handler_t> { + public: + explicit CefPrintHandlerCppToC(CefPrintHandler* cls); virtual ~CefPrintHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _PRINTHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/proxy_handler_cpptoc.cc b/libcef_dll/cpptoc/proxy_handler_cpptoc.cc index 47364193d..2243abd5b 100644 --- a/libcef_dll/cpptoc/proxy_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/proxy_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ void CEF_CALLBACK proxy_handler_get_proxy_for_url( struct _cef_proxy_handler_t* self, const cef_string_t* url, - struct _cef_proxy_info_t* proxy_info) -{ + struct _cef_proxy_info_t* proxy_info) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -53,8 +52,7 @@ void CEF_CALLBACK proxy_handler_get_proxy_for_url( CefProxyHandlerCppToC::CefProxyHandlerCppToC(CefProxyHandler* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.get_proxy_for_url = proxy_handler_get_proxy_for_url; } diff --git a/libcef_dll/cpptoc/proxy_handler_cpptoc.h b/libcef_dll/cpptoc/proxy_handler_cpptoc.h index ca698dca0..7dd0b64ad 100644 --- a/libcef_dll/cpptoc/proxy_handler_cpptoc.h +++ b/libcef_dll/cpptoc/proxy_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _PROXYHANDLER_CPPTOC_H -#define _PROXYHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_PROXY_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_PROXY_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_proxy_handler.h" #include "include/capi/cef_proxy_handler_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefProxyHandlerCppToC : public CefCppToC -{ -public: - CefProxyHandlerCppToC(CefProxyHandler* cls); + cef_proxy_handler_t> { + public: + explicit CefProxyHandlerCppToC(CefProxyHandler* cls); virtual ~CefProxyHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _PROXYHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_PROXY_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.cc b/libcef_dll/cpptoc/read_handler_cpptoc.cc index 0d073e88d..6ac89f694 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/read_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, - void* ptr, size_t size, size_t n) -{ + void* ptr, size_t size, size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -39,8 +38,7 @@ size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, } int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, - long offset, int whence) -{ + int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,8 +54,7 @@ int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, return _retval; } -long CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) -{ +int64 CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -65,14 +62,13 @@ long CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) return 0; // Execute - long _retval = CefReadHandlerCppToC::Get(self)->Tell(); + int64 _retval = CefReadHandlerCppToC::Get(self)->Tell(); // Return type: simple return _retval; } -int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) -{ +int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -90,8 +86,7 @@ int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) // CONSTRUCTOR - Do not edit by hand. CefReadHandlerCppToC::CefReadHandlerCppToC(CefReadHandler* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.read = read_handler_read; struct_.struct_.seek = read_handler_seek; struct_.struct_.tell = read_handler_tell; diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.h b/libcef_dll/cpptoc/read_handler_cpptoc.h index d6acba5d9..b4ca3c0c3 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.h +++ b/libcef_dll/cpptoc/read_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _READHANDLER_CPPTOC_H -#define _READHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -24,13 +25,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefReadHandlerCppToC - : public CefCppToC -{ -public: - CefReadHandlerCppToC(CefReadHandler* cls); + : public CefCppToC { + public: + explicit CefReadHandlerCppToC(CefReadHandler* cls); virtual ~CefReadHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _READHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc index 13f1b4d11..1aec01198 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ int CEF_CALLBACK render_handler_get_view_rect( struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_rect_t* rect) -{ + cef_rect_t* rect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -52,8 +51,7 @@ int CEF_CALLBACK render_handler_get_view_rect( int CEF_CALLBACK render_handler_get_screen_rect( struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_rect_t* rect) -{ + cef_rect_t* rect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -86,8 +84,7 @@ int CEF_CALLBACK render_handler_get_screen_rect( int CEF_CALLBACK render_handler_get_screen_point( struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX, - int viewY, int* screenX, int* screenY) -{ + int viewY, int* screenX, int* screenY) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,8 +128,7 @@ int CEF_CALLBACK render_handler_get_screen_point( } void CEF_CALLBACK render_handler_on_popup_show( - struct _cef_render_handler_t* self, cef_browser_t* browser, int show) -{ + struct _cef_render_handler_t* self, cef_browser_t* browser, int show) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -151,8 +147,7 @@ void CEF_CALLBACK render_handler_on_popup_show( void CEF_CALLBACK render_handler_on_popup_size( struct _cef_render_handler_t* self, cef_browser_t* browser, - const cef_rect_t* rect) -{ + const cef_rect_t* rect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -178,8 +173,8 @@ void CEF_CALLBACK render_handler_on_popup_size( void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, cef_browser_t* browser, enum cef_paint_element_type_t type, - size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer) -{ + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, + const void* buffer) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -216,8 +211,7 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, void CEF_CALLBACK render_handler_on_cursor_change( struct _cef_render_handler_t* self, cef_browser_t* browser, - cef_cursor_handle_t cursor) -{ + cef_cursor_handle_t cursor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -239,8 +233,7 @@ void CEF_CALLBACK render_handler_on_cursor_change( CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.get_view_rect = render_handler_get_view_rect; struct_.struct_.get_screen_rect = render_handler_get_screen_rect; struct_.struct_.get_screen_point = render_handler_get_screen_point; diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.h b/libcef_dll/cpptoc/render_handler_cpptoc.h index 0d8496aff..2ae7c11ac 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _RENDERHANDLER_CPPTOC_H -#define _RENDERHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_render_handler.h" #include "include/capi/cef_render_handler_capi.h" @@ -27,13 +28,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefRenderHandlerCppToC : public CefCppToC -{ -public: - CefRenderHandlerCppToC(CefRenderHandler* cls); + cef_render_handler_t> { + public: + explicit CefRenderHandlerCppToC(CefRenderHandler* cls); virtual ~CefRenderHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _RENDERHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/request_cpptoc.cc b/libcef_dll/cpptoc/request_cpptoc.cc index 2fb86d5a8..6d554cc1d 100644 --- a/libcef_dll/cpptoc/request_cpptoc.cc +++ b/libcef_dll/cpptoc/request_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_request_t* cef_request_create() -{ +CEF_EXPORT cef_request_t* cef_request_create() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -31,8 +30,8 @@ CEF_EXPORT cef_request_t* cef_request_create() // MEMBER FUNCTIONS - Body may be edited by hand. -cef_string_userfree_t CEF_CALLBACK request_get_url(struct _cef_request_t* self) -{ +cef_string_userfree_t CEF_CALLBACK request_get_url( + struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +46,7 @@ cef_string_userfree_t CEF_CALLBACK request_get_url(struct _cef_request_t* self) } void CEF_CALLBACK request_set_url(struct _cef_request_t* self, - const cef_string_t* url) -{ + const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -65,8 +63,7 @@ void CEF_CALLBACK request_set_url(struct _cef_request_t* self, } cef_string_userfree_t CEF_CALLBACK request_get_method( - struct _cef_request_t* self) -{ + struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,8 +78,7 @@ cef_string_userfree_t CEF_CALLBACK request_get_method( } void CEF_CALLBACK request_set_method(struct _cef_request_t* self, - const cef_string_t* method) -{ + const cef_string_t* method) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -99,8 +95,7 @@ void CEF_CALLBACK request_set_method(struct _cef_request_t* self, } struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( - struct _cef_request_t* self) -{ + struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,8 +110,7 @@ struct _cef_post_data_t* CEF_CALLBACK request_get_post_data( } void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, - struct _cef_post_data_t* postData) -{ + struct _cef_post_data_t* postData) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -133,8 +127,7 @@ void CEF_CALLBACK request_set_post_data(struct _cef_request_t* self, } void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, - cef_string_multimap_t headerMap) -{ + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -146,7 +139,7 @@ void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, return; // Translate param: headerMap; type: string_map_multi_byref - std::multimap headerMapMultimap; + std::multimap headerMapMultimap; transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute @@ -159,8 +152,7 @@ void CEF_CALLBACK request_get_header_map(struct _cef_request_t* self, } void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, - cef_string_multimap_t headerMap) -{ + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -172,7 +164,7 @@ void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, return; // Translate param: headerMap; type: string_map_multi_byref_const - std::multimap headerMapMultimap; + std::multimap headerMapMultimap; transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute @@ -182,8 +174,7 @@ void CEF_CALLBACK request_set_header_map(struct _cef_request_t* self, void CEF_CALLBACK request_set(struct _cef_request_t* self, const cef_string_t* url, const cef_string_t* method, - struct _cef_post_data_t* postData, cef_string_multimap_t headerMap) -{ + struct _cef_post_data_t* postData, cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -204,7 +195,7 @@ void CEF_CALLBACK request_set(struct _cef_request_t* self, // Unverified params: postData // Translate param: headerMap; type: string_map_multi_byref_const - std::multimap headerMapMultimap; + std::multimap headerMapMultimap; transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute @@ -216,8 +207,7 @@ void CEF_CALLBACK request_set(struct _cef_request_t* self, } enum cef_weburlrequest_flags_t CEF_CALLBACK request_get_flags( - struct _cef_request_t* self) -{ + struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -232,8 +222,7 @@ enum cef_weburlrequest_flags_t CEF_CALLBACK request_get_flags( } void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, - enum cef_weburlrequest_flags_t flags) -{ + enum cef_weburlrequest_flags_t flags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -246,8 +235,7 @@ void CEF_CALLBACK request_set_flags(struct _cef_request_t* self, } cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( - struct _cef_request_t* self) -{ + struct _cef_request_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -262,8 +250,7 @@ cef_string_userfree_t CEF_CALLBACK request_get_first_party_for_cookies( } void CEF_CALLBACK request_set_first_party_for_cookies( - struct _cef_request_t* self, const cef_string_t* url) -{ + struct _cef_request_t* self, const cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -283,8 +270,7 @@ void CEF_CALLBACK request_set_first_party_for_cookies( // CONSTRUCTOR - Do not edit by hand. CefRequestCppToC::CefRequestCppToC(CefRequest* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_url = request_get_url; struct_.struct_.set_url = request_set_url; struct_.struct_.get_method = request_get_method; diff --git a/libcef_dll/cpptoc/request_cpptoc.h b/libcef_dll/cpptoc/request_cpptoc.h index 1d725eae4..00c9c2042 100644 --- a/libcef_dll/cpptoc/request_cpptoc.h +++ b/libcef_dll/cpptoc/request_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _REQUEST_CPPTOC_H -#define _REQUEST_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_request.h" #include "include/capi/cef_request_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefRequestCppToC - : public CefCppToC -{ -public: - CefRequestCppToC(CefRequest* cls); + : public CefCppToC { + public: + explicit CefRequestCppToC(CefRequest* cls); virtual ~CefRequestCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _REQUEST_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.cc b/libcef_dll/cpptoc/request_handler_cpptoc.cc index 6426b3124..6e9d66bb1 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -25,8 +25,7 @@ int CEF_CALLBACK request_handler_on_before_browse( struct _cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, - enum cef_handler_navtype_t navType, int isRedirect) -{ + enum cef_handler_navtype_t navType, int isRedirect) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -61,8 +60,7 @@ int CEF_CALLBACK request_handler_on_before_resource_load( struct _cef_request_handler_t* self, cef_browser_t* browser, cef_request_t* request, cef_string_t* redirectUrl, struct _cef_stream_reader_t** resourceStream, - struct _cef_response_t* response, int loadFlags) -{ + struct _cef_response_t* response, int loadFlags) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,8 +121,7 @@ int CEF_CALLBACK request_handler_on_before_resource_load( void CEF_CALLBACK request_handler_on_resource_redirect( struct _cef_request_handler_t* self, cef_browser_t* browser, - const cef_string_t* old_url, cef_string_t* new_url) -{ + const cef_string_t* old_url, cef_string_t* new_url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -156,8 +153,7 @@ void CEF_CALLBACK request_handler_on_resource_redirect( void CEF_CALLBACK request_handler_on_resource_response( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* url, struct _cef_response_t* response, - cef_content_filter_t** filter) -{ + cef_content_filter_t** filter) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -207,8 +203,7 @@ void CEF_CALLBACK request_handler_on_resource_response( int CEF_CALLBACK request_handler_on_protocol_execution( struct _cef_request_handler_t* self, cef_browser_t* browser, - const cef_string_t* url, int* allowOSExecution) -{ + const cef_string_t* url, int* allowOSExecution) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -248,8 +243,7 @@ int CEF_CALLBACK request_handler_on_protocol_execution( int CEF_CALLBACK request_handler_get_download_handler( struct _cef_request_handler_t* self, cef_browser_t* browser, const cef_string_t* mimeType, const cef_string_t* fileName, - int64 contentLength, cef_download_handler_t** handler) -{ + int64 contentLength, cef_download_handler_t** handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -305,8 +299,7 @@ int CEF_CALLBACK request_handler_get_auth_credentials( struct _cef_request_handler_t* self, cef_browser_t* browser, int isProxy, const cef_string_t* host, int port, const cef_string_t* realm, const cef_string_t* scheme, cef_string_t* username, - cef_string_t* password) -{ + cef_string_t* password) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -359,8 +352,7 @@ int CEF_CALLBACK request_handler_get_auth_credentials( CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls) : CefCppToC(cls) -{ + cef_request_handler_t>(cls) { struct_.struct_.on_before_browse = request_handler_on_before_browse; struct_.struct_.on_before_resource_load = request_handler_on_before_resource_load; diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.h b/libcef_dll/cpptoc/request_handler_cpptoc.h index 61b343b19..9249e8788 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _REQUESTHANDLER_CPPTOC_H -#define _REQUESTHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefRequestHandlerCppToC : public CefCppToC -{ -public: - CefRequestHandlerCppToC(CefRequestHandler* cls); + cef_request_handler_t> { + public: + explicit CefRequestHandlerCppToC(CefRequestHandler* cls); virtual ~CefRequestHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _REQUESTHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/response_cpptoc.cc b/libcef_dll/cpptoc/response_cpptoc.cc index b1dc7b02d..be51c228f 100644 --- a/libcef_dll/cpptoc/response_cpptoc.cc +++ b/libcef_dll/cpptoc/response_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK response_get_status(struct _cef_response_t* self) -{ +int CEF_CALLBACK response_get_status(struct _cef_response_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -31,8 +30,8 @@ int CEF_CALLBACK response_get_status(struct _cef_response_t* self) return _retval; } -void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status) -{ +void CEF_CALLBACK response_set_status(struct _cef_response_t* self, + int status) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -45,8 +44,7 @@ void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status) } cef_string_userfree_t CEF_CALLBACK response_get_status_text( - struct _cef_response_t* self) -{ + struct _cef_response_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -61,8 +59,7 @@ cef_string_userfree_t CEF_CALLBACK response_get_status_text( } void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, - const cef_string_t* statusText) -{ + const cef_string_t* statusText) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,8 +76,7 @@ void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self, } cef_string_userfree_t CEF_CALLBACK response_get_mime_type( - struct _cef_response_t* self) -{ + struct _cef_response_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -95,8 +91,7 @@ cef_string_userfree_t CEF_CALLBACK response_get_mime_type( } void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, - const cef_string_t* mimeType) -{ + const cef_string_t* mimeType) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -113,8 +108,7 @@ void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self, } cef_string_userfree_t CEF_CALLBACK response_get_header( - struct _cef_response_t* self, const cef_string_t* name) -{ + struct _cef_response_t* self, const cef_string_t* name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -134,8 +128,7 @@ cef_string_userfree_t CEF_CALLBACK response_get_header( } void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, - cef_string_multimap_t headerMap) -{ + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -147,7 +140,7 @@ void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, return; // Translate param: headerMap; type: string_map_multi_byref - std::multimap headerMapMultimap; + std::multimap headerMapMultimap; transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute @@ -160,8 +153,7 @@ void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self, } void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, - cef_string_multimap_t headerMap) -{ + cef_string_multimap_t headerMap) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -173,7 +165,7 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, return; // Translate param: headerMap; type: string_map_multi_byref_const - std::multimap headerMapMultimap; + std::multimap headerMapMultimap; transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute @@ -185,8 +177,7 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, // CONSTRUCTOR - Do not edit by hand. CefResponseCppToC::CefResponseCppToC(CefResponse* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_status = response_get_status; struct_.struct_.set_status = response_set_status; struct_.struct_.get_status_text = response_get_status_text; diff --git a/libcef_dll/cpptoc/response_cpptoc.h b/libcef_dll/cpptoc/response_cpptoc.h index c58f535a9..7397974e6 100644 --- a/libcef_dll/cpptoc/response_cpptoc.h +++ b/libcef_dll/cpptoc/response_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _RESPONSE_CPPTOC_H -#define _RESPONSE_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_response.h" #include "include/capi/cef_response_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefResponseCppToC - : public CefCppToC -{ -public: - CefResponseCppToC(CefResponse* cls); + : public CefCppToC { + public: + explicit CefResponseCppToC(CefResponse* cls); virtual ~CefResponseCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _RESPONSE_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc index be886632c..e67e86c9a 100644 --- a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK scheme_handler_callback_headers_available( - struct _cef_scheme_handler_callback_t* self) -{ + struct _cef_scheme_handler_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -29,8 +28,7 @@ void CEF_CALLBACK scheme_handler_callback_headers_available( } void CEF_CALLBACK scheme_handler_callback_bytes_available( - struct _cef_scheme_handler_callback_t* self) -{ + struct _cef_scheme_handler_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -42,8 +40,7 @@ void CEF_CALLBACK scheme_handler_callback_bytes_available( } void CEF_CALLBACK scheme_handler_callback_cancel( - struct _cef_scheme_handler_callback_t* self) -{ + struct _cef_scheme_handler_callback_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -60,8 +57,7 @@ void CEF_CALLBACK scheme_handler_callback_cancel( CefSchemeHandlerCallbackCppToC::CefSchemeHandlerCallbackCppToC( CefSchemeHandlerCallback* cls) : CefCppToC(cls) -{ + cef_scheme_handler_callback_t>(cls) { struct_.struct_.headers_available = scheme_handler_callback_headers_available; struct_.struct_.bytes_available = scheme_handler_callback_bytes_available; struct_.struct_.cancel = scheme_handler_callback_cancel; diff --git a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h index 72ed86bea..fe5d268d1 100644 --- a/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_callback_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _SCHEMEHANDLERCALLBACK_CPPTOC_H -#define _SCHEMEHANDLERCALLBACK_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_CALLBACK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_CALLBACK_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" @@ -31,13 +32,12 @@ // This class may be instantiated and accessed DLL-side only. class CefSchemeHandlerCallbackCppToC : public CefCppToC -{ -public: - CefSchemeHandlerCallbackCppToC(CefSchemeHandlerCallback* cls); + cef_scheme_handler_callback_t> { + public: + explicit CefSchemeHandlerCallbackCppToC(CefSchemeHandlerCallback* cls); virtual ~CefSchemeHandlerCallbackCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _SCHEMEHANDLERCALLBACK_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_CALLBACK_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/scheme_handler_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_cpptoc.cc index bee349f8d..a613a3cf0 100644 --- a/libcef_dll/cpptoc/scheme_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ int CEF_CALLBACK scheme_handler_process_request( struct _cef_scheme_handler_t* self, cef_request_t* request, - cef_scheme_handler_callback_t* callback) -{ + cef_scheme_handler_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -47,8 +46,7 @@ int CEF_CALLBACK scheme_handler_process_request( void CEF_CALLBACK scheme_handler_get_response_headers( struct _cef_scheme_handler_t* self, cef_response_t* response, - int64* response_length, cef_string_t* redirectUrl) -{ + int64* response_length, cef_string_t* redirectUrl) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -85,8 +83,7 @@ void CEF_CALLBACK scheme_handler_get_response_headers( int CEF_CALLBACK scheme_handler_read_response( struct _cef_scheme_handler_t* self, void* data_out, int bytes_to_read, - int* bytes_read, cef_scheme_handler_callback_t* callback) -{ + int* bytes_read, cef_scheme_handler_callback_t* callback) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,8 +120,7 @@ int CEF_CALLBACK scheme_handler_read_response( return _retval; } -void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self) -{ +void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -140,8 +136,7 @@ void CEF_CALLBACK scheme_handler_cancel(struct _cef_scheme_handler_t* self) CefSchemeHandlerCppToC::CefSchemeHandlerCppToC(CefSchemeHandler* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.process_request = scheme_handler_process_request; struct_.struct_.get_response_headers = scheme_handler_get_response_headers; struct_.struct_.read_response = scheme_handler_read_response; diff --git a/libcef_dll/cpptoc/scheme_handler_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_cpptoc.h index 6513f0a21..a151e0696 100644 --- a/libcef_dll/cpptoc/scheme_handler_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _SCHEMEHANDLER_CPPTOC_H -#define _SCHEMEHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" @@ -31,13 +32,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefSchemeHandlerCppToC : public CefCppToC -{ -public: - CefSchemeHandlerCppToC(CefSchemeHandler* cls); + cef_scheme_handler_t> { + public: + explicit CefSchemeHandlerCppToC(CefSchemeHandler* cls); virtual ~CefSchemeHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _SCHEMEHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc index 174770b19..258543110 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ struct _cef_scheme_handler_t* CEF_CALLBACK scheme_handler_factory_create( struct _cef_scheme_handler_factory_t* self, cef_browser_t* browser, - const cef_string_t* scheme_name, cef_request_t* request) -{ + const cef_string_t* scheme_name, cef_request_t* request) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -57,8 +56,7 @@ struct _cef_scheme_handler_t* CEF_CALLBACK scheme_handler_factory_create( CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC( CefSchemeHandlerFactory* cls) : CefCppToC(cls) -{ + cef_scheme_handler_factory_t>(cls) { struct_.struct_.create = scheme_handler_factory_create; } diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h index 527ef0344..e49998b41 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _SCHEMEHANDLERFACTORY_CPPTOC_H -#define _SCHEMEHANDLERFACTORY_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" @@ -31,13 +32,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefSchemeHandlerFactoryCppToC : public CefCppToC -{ -public: - CefSchemeHandlerFactoryCppToC(CefSchemeHandlerFactory* cls); + cef_scheme_handler_factory_t> { + public: + explicit CefSchemeHandlerFactoryCppToC(CefSchemeHandlerFactory* cls); virtual ~CefSchemeHandlerFactoryCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _SCHEMEHANDLERFACTORY_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/storage_visitor_cpptoc.cc b/libcef_dll/cpptoc/storage_visitor_cpptoc.cc index 7dea2cb31..b5c4a42ac 100644 --- a/libcef_dll/cpptoc/storage_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/storage_visitor_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ int CEF_CALLBACK storage_visitor_visit(struct _cef_storage_visitor_t* self, enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key, const cef_string_t* value, int count, int total, - int* deleteData) -{ + int* deleteData) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -68,8 +67,7 @@ int CEF_CALLBACK storage_visitor_visit(struct _cef_storage_visitor_t* self, CefStorageVisitorCppToC::CefStorageVisitorCppToC(CefStorageVisitor* cls) : CefCppToC(cls) -{ + cef_storage_visitor_t>(cls) { struct_.struct_.visit = storage_visitor_visit; } diff --git a/libcef_dll/cpptoc/storage_visitor_cpptoc.h b/libcef_dll/cpptoc/storage_visitor_cpptoc.h index 4f2c567d4..af8569853 100644 --- a/libcef_dll/cpptoc/storage_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/storage_visitor_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _STORAGEVISITOR_CPPTOC_H -#define _STORAGEVISITOR_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_STORAGE_VISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_STORAGE_VISITOR_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_storage.h" #include "include/capi/cef_storage_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefStorageVisitorCppToC : public CefCppToC -{ -public: - CefStorageVisitorCppToC(CefStorageVisitor* cls); + cef_storage_visitor_t> { + public: + explicit CefStorageVisitorCppToC(CefStorageVisitor* cls); virtual ~CefStorageVisitorCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _STORAGEVISITOR_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_STORAGE_VISITOR_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/libcef_dll/cpptoc/stream_reader_cpptoc.cc index ddf1d9be7..bfaf07f2b 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( - const cef_string_t* fileName) -{ + const cef_string_t* fileName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: fileName; type: string_byref_const @@ -35,8 +34,7 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( } CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, - size_t size) -{ + size_t size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -54,8 +52,7 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, } CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( - cef_read_handler_t* handler) -{ + cef_read_handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: handler; type: refptr_diff @@ -75,8 +72,7 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, - void* ptr, size_t size, size_t n) -{ + void* ptr, size_t size, size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -98,8 +94,7 @@ size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, } int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, - long offset, int whence) -{ + int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,8 +110,7 @@ int CEF_CALLBACK stream_reader_seek(struct _cef_stream_reader_t* self, return _retval; } -long CEF_CALLBACK stream_reader_tell(struct _cef_stream_reader_t* self) -{ +int64 CEF_CALLBACK stream_reader_tell(struct _cef_stream_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -124,14 +118,13 @@ long CEF_CALLBACK stream_reader_tell(struct _cef_stream_reader_t* self) return 0; // Execute - long _retval = CefStreamReaderCppToC::Get(self)->Tell(); + int64 _retval = CefStreamReaderCppToC::Get(self)->Tell(); // Return type: simple return _retval; } -int CEF_CALLBACK stream_reader_eof(struct _cef_stream_reader_t* self) -{ +int CEF_CALLBACK stream_reader_eof(struct _cef_stream_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -150,8 +143,7 @@ int CEF_CALLBACK stream_reader_eof(struct _cef_stream_reader_t* self) CefStreamReaderCppToC::CefStreamReaderCppToC(CefStreamReader* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.read = stream_reader_read; struct_.struct_.seek = stream_reader_seek; struct_.struct_.tell = stream_reader_tell; diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.h b/libcef_dll/cpptoc/stream_reader_cpptoc.h index 58ec7fa2f..3dee6cad0 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.h +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _STREAMREADER_CPPTOC_H -#define _STREAMREADER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed DLL-side only. class CefStreamReaderCppToC : public CefCppToC -{ -public: - CefStreamReaderCppToC(CefStreamReader* cls); + cef_stream_reader_t> { + public: + explicit CefStreamReaderCppToC(CefStreamReader* cls); virtual ~CefStreamReaderCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _STREAMREADER_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/libcef_dll/cpptoc/stream_writer_cpptoc.cc index 61b92d26f..6c4c5b2dd 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( - const cef_string_t* fileName) -{ + const cef_string_t* fileName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: fileName; type: string_byref_const @@ -35,8 +34,7 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( } CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( - cef_write_handler_t* handler) -{ + cef_write_handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: handler; type: refptr_diff @@ -56,8 +54,7 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, - const void* ptr, size_t size, size_t n) -{ + const void* ptr, size_t size, size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -79,8 +76,7 @@ size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, } int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, - long offset, int whence) -{ + int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -96,8 +92,7 @@ int CEF_CALLBACK stream_writer_seek(struct _cef_stream_writer_t* self, return _retval; } -long CEF_CALLBACK stream_writer_tell(struct _cef_stream_writer_t* self) -{ +int64 CEF_CALLBACK stream_writer_tell(struct _cef_stream_writer_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -105,14 +100,13 @@ long CEF_CALLBACK stream_writer_tell(struct _cef_stream_writer_t* self) return 0; // Execute - long _retval = CefStreamWriterCppToC::Get(self)->Tell(); + int64 _retval = CefStreamWriterCppToC::Get(self)->Tell(); // Return type: simple return _retval; } -int CEF_CALLBACK stream_writer_flush(struct _cef_stream_writer_t* self) -{ +int CEF_CALLBACK stream_writer_flush(struct _cef_stream_writer_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,8 +125,7 @@ int CEF_CALLBACK stream_writer_flush(struct _cef_stream_writer_t* self) CefStreamWriterCppToC::CefStreamWriterCppToC(CefStreamWriter* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.write = stream_writer_write; struct_.struct_.seek = stream_writer_seek; struct_.struct_.tell = stream_writer_tell; diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.h b/libcef_dll/cpptoc/stream_writer_cpptoc.h index 619e4d114..b10d2f670 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.h +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _STREAMWRITER_CPPTOC_H -#define _STREAMWRITER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed DLL-side only. class CefStreamWriterCppToC : public CefCppToC -{ -public: - CefStreamWriterCppToC(CefStreamWriter* cls); + cef_stream_writer_t> { + public: + explicit CefStreamWriterCppToC(CefStreamWriter* cls); virtual ~CefStreamWriterCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _STREAMWRITER_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/task_cpptoc.cc b/libcef_dll/cpptoc/task_cpptoc.cc index 7e9139713..a5e31e6b1 100644 --- a/libcef_dll/cpptoc/task_cpptoc.cc +++ b/libcef_dll/cpptoc/task_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK task_execute(struct _cef_task_t* self, - cef_thread_id_t threadId) -{ + cef_thread_id_t threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -33,8 +32,7 @@ void CEF_CALLBACK task_execute(struct _cef_task_t* self, // CONSTRUCTOR - Do not edit by hand. CefTaskCppToC::CefTaskCppToC(CefTask* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.execute = task_execute; } diff --git a/libcef_dll/cpptoc/task_cpptoc.h b/libcef_dll/cpptoc/task_cpptoc.h index 1241955e4..8f2e2fc2e 100644 --- a/libcef_dll/cpptoc/task_cpptoc.h +++ b/libcef_dll/cpptoc/task_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _TASK_CPPTOC_H -#define _TASK_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_task.h" #include "include/capi/cef_task_capi.h" @@ -24,13 +25,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefTaskCppToC - : public CefCppToC -{ -public: - CefTaskCppToC(CefTask* cls); + : public CefCppToC { + public: + explicit CefTaskCppToC(CefTask* cls); virtual ~CefTaskCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _TASK_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/libcef_dll/cpptoc/v8accessor_cpptoc.cc index 336f6593e..d533fcf06 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.cc +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t** retval, cef_string_t* exception) -{ + struct _cef_v8value_t** retval, cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -74,8 +73,7 @@ int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, const cef_string_t* name, struct _cef_v8value_t* object, - struct _cef_v8value_t* value, cef_string_t* exception) -{ + struct _cef_v8value_t* value, cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -116,8 +114,7 @@ int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, // CONSTRUCTOR - Do not edit by hand. CefV8AccessorCppToC::CefV8AccessorCppToC(CefV8Accessor* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get = v8accessor_get; struct_.struct_.set = v8accessor_set; } diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.h b/libcef_dll/cpptoc/v8accessor_cpptoc.h index eefaed3d6..10cdbdb59 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.h +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8ACCESSOR_CPPTOC_H -#define _V8ACCESSOR_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,13 +29,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefV8AccessorCppToC - : public CefCppToC -{ -public: - CefV8AccessorCppToC(CefV8Accessor* cls); + : public CefCppToC { + public: + explicit CefV8AccessorCppToC(CefV8Accessor* cls); virtual ~CefV8AccessorCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _V8ACCESSOR_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/v8context_cpptoc.cc b/libcef_dll/cpptoc/v8context_cpptoc.cc index fb0d6e4de..8643ea7a4 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() -{ +CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -29,8 +28,7 @@ CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() return CefV8ContextCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() -{ +CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -40,8 +38,7 @@ CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() return CefV8ContextCppToC::Wrap(_retval); } -CEF_EXPORT int cef_v8context_in_context() -{ +CEF_EXPORT int cef_v8context_in_context() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -54,8 +51,8 @@ CEF_EXPORT int cef_v8context_in_context() // MEMBER FUNCTIONS - Body may be edited by hand. -cef_browser_t* CEF_CALLBACK v8context_get_browser(struct _cef_v8context_t* self) -{ +cef_browser_t* CEF_CALLBACK v8context_get_browser( + struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -69,8 +66,7 @@ cef_browser_t* CEF_CALLBACK v8context_get_browser(struct _cef_v8context_t* self) return CefBrowserCppToC::Wrap(_retval); } -cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) -{ +cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -85,8 +81,7 @@ cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) } struct _cef_v8value_t* CEF_CALLBACK v8context_get_global( - struct _cef_v8context_t* self) -{ + struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -100,8 +95,7 @@ struct _cef_v8value_t* CEF_CALLBACK v8context_get_global( return CefV8ValueCppToC::Wrap(_retval); } -int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) -{ +int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -115,8 +109,7 @@ int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) return _retval; } -int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) -{ +int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -131,8 +124,7 @@ int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) } int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, - struct _cef_v8context_t* that) -{ + struct _cef_v8context_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -155,8 +147,7 @@ int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self, // CONSTRUCTOR - Do not edit by hand. CefV8ContextCppToC::CefV8ContextCppToC(CefV8Context* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_browser = v8context_get_browser; struct_.struct_.get_frame = v8context_get_frame; struct_.struct_.get_global = v8context_get_global; diff --git a/libcef_dll/cpptoc/v8context_cpptoc.h b/libcef_dll/cpptoc/v8context_cpptoc.h index b6049d63f..2eeae4a5c 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8CONTEXT_CPPTOC_H -#define _V8CONTEXT_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,13 +29,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefV8ContextCppToC - : public CefCppToC -{ -public: - CefV8ContextCppToC(CefV8Context* cls); + : public CefCppToC { + public: + explicit CefV8ContextCppToC(CefV8Context* cls); virtual ~CefV8ContextCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _V8CONTEXT_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/v8context_handler_cpptoc.cc b/libcef_dll/cpptoc/v8context_handler_cpptoc.cc index a4616a15f..2c426834c 100644 --- a/libcef_dll/cpptoc/v8context_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ void CEF_CALLBACK v8context_handler_on_context_created( struct _cef_v8context_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_v8context_t* context) -{ + cef_frame_t* frame, cef_v8context_t* context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -49,8 +48,7 @@ void CEF_CALLBACK v8context_handler_on_context_created( void CEF_CALLBACK v8context_handler_on_context_released( struct _cef_v8context_handler_t* self, cef_browser_t* browser, - cef_frame_t* frame, cef_v8context_t* context) -{ + cef_frame_t* frame, cef_v8context_t* context) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -81,8 +79,7 @@ void CEF_CALLBACK v8context_handler_on_context_released( CefV8ContextHandlerCppToC::CefV8ContextHandlerCppToC(CefV8ContextHandler* cls) : CefCppToC(cls) -{ + cef_v8context_handler_t>(cls) { struct_.struct_.on_context_created = v8context_handler_on_context_created; struct_.struct_.on_context_released = v8context_handler_on_context_released; } diff --git a/libcef_dll/cpptoc/v8context_handler_cpptoc.h b/libcef_dll/cpptoc/v8context_handler_cpptoc.h index 59618229e..153fbce6f 100644 --- a/libcef_dll/cpptoc/v8context_handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8CONTEXTHANDLER_CPPTOC_H -#define _V8CONTEXTHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_v8context_handler.h" #include "include/capi/cef_v8context_handler_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefV8ContextHandlerCppToC : public CefCppToC -{ -public: - CefV8ContextHandlerCppToC(CefV8ContextHandler* cls); + cef_v8context_handler_t> { + public: + explicit CefV8ContextHandlerCppToC(CefV8ContextHandler* cls); virtual ~CefV8ContextHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _V8CONTEXTHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.cc b/libcef_dll/cpptoc/v8exception_cpptoc.cc index 1d6f9045a..264fa8da9 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.cc +++ b/libcef_dll/cpptoc/v8exception_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK v8exception_get_message( - struct _cef_v8exception_t* self) -{ + struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -32,8 +31,7 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_message( } cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( - struct _cef_v8exception_t* self) -{ + struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -48,8 +46,7 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_source_line( } cef_string_userfree_t CEF_CALLBACK v8exception_get_script_resource_name( - struct _cef_v8exception_t* self) -{ + struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -63,8 +60,7 @@ cef_string_userfree_t CEF_CALLBACK v8exception_get_script_resource_name( return _retval.DetachToUserFree(); } -int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) -{ +int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -78,8 +74,8 @@ int CEF_CALLBACK v8exception_get_line_number(struct _cef_v8exception_t* self) return _retval; } -int CEF_CALLBACK v8exception_get_start_position(struct _cef_v8exception_t* self) -{ +int CEF_CALLBACK v8exception_get_start_position( + struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,8 +89,7 @@ int CEF_CALLBACK v8exception_get_start_position(struct _cef_v8exception_t* self) return _retval; } -int CEF_CALLBACK v8exception_get_end_position(struct _cef_v8exception_t* self) -{ +int CEF_CALLBACK v8exception_get_end_position(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -108,8 +103,7 @@ int CEF_CALLBACK v8exception_get_end_position(struct _cef_v8exception_t* self) return _retval; } -int CEF_CALLBACK v8exception_get_start_column(struct _cef_v8exception_t* self) -{ +int CEF_CALLBACK v8exception_get_start_column(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -123,8 +117,7 @@ int CEF_CALLBACK v8exception_get_start_column(struct _cef_v8exception_t* self) return _retval; } -int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) -{ +int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -142,8 +135,7 @@ int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) // CONSTRUCTOR - Do not edit by hand. CefV8ExceptionCppToC::CefV8ExceptionCppToC(CefV8Exception* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.get_message = v8exception_get_message; struct_.struct_.get_source_line = v8exception_get_source_line; struct_.struct_.get_script_resource_name = diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.h b/libcef_dll/cpptoc/v8exception_cpptoc.h index de8f67149..3179a9e57 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.h +++ b/libcef_dll/cpptoc/v8exception_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8EXCEPTION_CPPTOC_H -#define _V8EXCEPTION_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,13 +29,13 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefV8ExceptionCppToC - : public CefCppToC -{ -public: - CefV8ExceptionCppToC(CefV8Exception* cls); + : public CefCppToC { + public: + explicit CefV8ExceptionCppToC(CefV8Exception* cls); virtual ~CefV8ExceptionCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _V8EXCEPTION_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.cc b/libcef_dll/cpptoc/v8handler_cpptoc.cc index 6af008547..08f003247 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, const cef_string_t* name, struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, - struct _cef_v8value_t** retval, cef_string_t* exception) -{ + struct _cef_v8value_t** retval, cef_string_t* exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -89,8 +88,7 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, // CONSTRUCTOR - Do not edit by hand. CefV8HandlerCppToC::CefV8HandlerCppToC(CefV8Handler* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.execute = v8handler_execute; } diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.h b/libcef_dll/cpptoc/v8handler_cpptoc.h index 46cb22fb5..c6c159ee7 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8HANDLER_CPPTOC_H -#define _V8HANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,13 +29,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed wrapper-side only. class CefV8HandlerCppToC - : public CefCppToC -{ -public: - CefV8HandlerCppToC(CefV8Handler* cls); + : public CefCppToC { + public: + explicit CefV8HandlerCppToC(CefV8Handler* cls); virtual ~CefV8HandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _V8HANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/v8value_cpptoc.cc b/libcef_dll/cpptoc/v8value_cpptoc.cc index ce42534eb..0d9cfb47b 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.cc +++ b/libcef_dll/cpptoc/v8value_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -21,8 +21,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined() -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -32,8 +31,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined() return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_null() -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_null() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -43,8 +41,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_null() return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -55,8 +52,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value) return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value) -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -67,8 +63,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int value) return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -79,8 +74,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value) return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: date; type: simple_byref_const @@ -99,8 +93,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date) return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: value @@ -114,8 +107,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value) } CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor( - cef_base_t* user_data, cef_v8accessor_t* accessor) -{ + cef_base_t* user_data, cef_v8accessor_t* accessor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: user_data, accessor @@ -129,8 +121,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_object_with_accessor( return CefV8ValueCppToC::Wrap(_retval); } -CEF_EXPORT cef_v8value_t* cef_v8value_create_array() -{ +CEF_EXPORT cef_v8value_t* cef_v8value_create_array() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -141,8 +132,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_array() } CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, - cef_v8handler_t* handler) -{ + cef_v8handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: name; type: string_byref_const @@ -166,8 +156,7 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK v8value_is_undefined(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_undefined(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -181,8 +170,7 @@ int CEF_CALLBACK v8value_is_undefined(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -196,8 +184,7 @@ int CEF_CALLBACK v8value_is_null(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -211,8 +198,7 @@ int CEF_CALLBACK v8value_is_bool(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -226,8 +212,7 @@ int CEF_CALLBACK v8value_is_int(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -241,8 +226,7 @@ int CEF_CALLBACK v8value_is_double(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -256,8 +240,7 @@ int CEF_CALLBACK v8value_is_date(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_string(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_string(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -271,8 +254,7 @@ int CEF_CALLBACK v8value_is_string(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_object(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_object(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -286,8 +268,7 @@ int CEF_CALLBACK v8value_is_object(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -301,8 +282,7 @@ int CEF_CALLBACK v8value_is_array(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -317,8 +297,7 @@ int CEF_CALLBACK v8value_is_function(struct _cef_v8value_t* self) } int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, - struct _cef_v8value_t* that) -{ + struct _cef_v8value_t* that) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -337,8 +316,7 @@ int CEF_CALLBACK v8value_is_same(struct _cef_v8value_t* self, return _retval; } -int CEF_CALLBACK v8value_get_bool_value(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_get_bool_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -352,8 +330,7 @@ int CEF_CALLBACK v8value_get_bool_value(struct _cef_v8value_t* self) return _retval; } -int CEF_CALLBACK v8value_get_int_value(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_get_int_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -367,8 +344,7 @@ int CEF_CALLBACK v8value_get_int_value(struct _cef_v8value_t* self) return _retval; } -double CEF_CALLBACK v8value_get_double_value(struct _cef_v8value_t* self) -{ +double CEF_CALLBACK v8value_get_double_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -382,8 +358,7 @@ double CEF_CALLBACK v8value_get_double_value(struct _cef_v8value_t* self) return _retval; } -cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) -{ +cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -398,8 +373,7 @@ cef_time_t CEF_CALLBACK v8value_get_date_value(struct _cef_v8value_t* self) } cef_string_userfree_t CEF_CALLBACK v8value_get_string_value( - struct _cef_v8value_t* self) -{ + struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -414,8 +388,7 @@ cef_string_userfree_t CEF_CALLBACK v8value_get_string_value( } int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, - const cef_string_t* key) -{ + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -435,15 +408,14 @@ int CEF_CALLBACK v8value_has_value_bykey(struct _cef_v8value_t* self, } int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, - int index) -{ + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return 0; // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return 0; @@ -456,8 +428,7 @@ int CEF_CALLBACK v8value_has_value_byindex(struct _cef_v8value_t* self, } int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, - const cef_string_t* key) -{ + const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -477,15 +448,14 @@ int CEF_CALLBACK v8value_delete_value_bykey(struct _cef_v8value_t* self, } int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, - int index) -{ + int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return 0; // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return 0; @@ -498,8 +468,7 @@ int CEF_CALLBACK v8value_delete_value_byindex(struct _cef_v8value_t* self, } struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( - struct _cef_v8value_t* self, const cef_string_t* key) -{ + struct _cef_v8value_t* self, const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -519,15 +488,14 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_bykey( } struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( - struct _cef_v8value_t* self, int index) -{ + struct _cef_v8value_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return NULL; // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return NULL; @@ -541,8 +509,7 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_get_value_byindex( int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, const cef_string_t* key, struct _cef_v8value_t* value, - enum cef_v8_propertyattribute_t attribute) -{ + enum cef_v8_propertyattribute_t attribute) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -568,15 +535,14 @@ int CEF_CALLBACK v8value_set_value_bykey(struct _cef_v8value_t* self, } int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, - int index, struct _cef_v8value_t* value) -{ + int index, struct _cef_v8value_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return 0; // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return 0; // Verify param: value; type: refptr_same @@ -595,8 +561,7 @@ int CEF_CALLBACK v8value_set_value_byindex(struct _cef_v8value_t* self, int CEF_CALLBACK v8value_set_value_byaccessor(struct _cef_v8value_t* self, const cef_string_t* key, enum cef_v8_accesscontrol_t settings, - enum cef_v8_propertyattribute_t attribute) -{ + enum cef_v8_propertyattribute_t attribute) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -618,8 +583,7 @@ int CEF_CALLBACK v8value_set_value_byaccessor(struct _cef_v8value_t* self, } int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, - cef_string_list_t keys) -{ + cef_string_list_t keys) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -646,8 +610,7 @@ int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self, return _retval; } -cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) -{ +cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -661,8 +624,7 @@ cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) return CefBaseCToCpp::Unwrap(_retval); } -int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) -{ +int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -677,8 +639,7 @@ int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) } cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( - struct _cef_v8value_t* self) -{ + struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -693,8 +654,7 @@ cef_string_userfree_t CEF_CALLBACK v8value_get_function_name( } cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( - struct _cef_v8value_t* self) -{ + struct _cef_v8value_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -712,8 +672,7 @@ cef_v8handler_t* CEF_CALLBACK v8value_get_function_handler( int CEF_CALLBACK v8value_execute_function(struct _cef_v8value_t* self, struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, - cef_v8exception_t** exception, int rethrow_exception) -{ + cef_v8exception_t** exception, int rethrow_exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -788,8 +747,7 @@ int CEF_CALLBACK v8value_execute_function_with_context( struct _cef_v8value_t* self, cef_v8context_t* context, struct _cef_v8value_t* object, size_t argumentsCount, struct _cef_v8value_t* const* arguments, struct _cef_v8value_t** retval, - cef_v8exception_t** exception, int rethrow_exception) -{ + cef_v8exception_t** exception, int rethrow_exception) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -869,8 +827,7 @@ int CEF_CALLBACK v8value_execute_function_with_context( // CONSTRUCTOR - Do not edit by hand. CefV8ValueCppToC::CefV8ValueCppToC(CefV8Value* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.is_undefined = v8value_is_undefined; struct_.struct_.is_null = v8value_is_null; struct_.struct_.is_bool = v8value_is_bool; diff --git a/libcef_dll/cpptoc/v8value_cpptoc.h b/libcef_dll/cpptoc/v8value_cpptoc.h index 75e4c1aa6..a3164753e 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.h +++ b/libcef_dll/cpptoc/v8value_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8VALUE_CPPTOC_H -#define _V8VALUE_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,13 +29,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefV8ValueCppToC - : public CefCppToC -{ -public: - CefV8ValueCppToC(CefV8Value* cls); + : public CefCppToC { + public: + explicit CefV8ValueCppToC(CefV8Value* cls); virtual ~CefV8ValueCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _V8VALUE_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc index 7acc8b50d..d576345e0 100644 --- a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc +++ b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ void CEF_CALLBACK web_urlrequest_client_on_state_change( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, - enum cef_weburlrequest_state_t state) -{ + enum cef_weburlrequest_state_t state) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -40,8 +39,7 @@ void CEF_CALLBACK web_urlrequest_client_on_state_change( void CEF_CALLBACK web_urlrequest_client_on_redirect( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, - cef_request_t* request, cef_response_t* response) -{ + cef_request_t* request, cef_response_t* response) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -69,8 +67,7 @@ void CEF_CALLBACK web_urlrequest_client_on_redirect( void CEF_CALLBACK web_urlrequest_client_on_headers_received( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, - cef_response_t* response) -{ + cef_response_t* response) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -93,8 +90,7 @@ void CEF_CALLBACK web_urlrequest_client_on_headers_received( void CEF_CALLBACK web_urlrequest_client_on_progress( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, - uint64 bytesSent, uint64 totalBytesToBeSent) -{ + uint64 bytesSent, uint64 totalBytesToBeSent) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -114,8 +110,7 @@ void CEF_CALLBACK web_urlrequest_client_on_progress( void CEF_CALLBACK web_urlrequest_client_on_data( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, - const void* data, int dataLength) -{ + const void* data, int dataLength) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -139,8 +134,7 @@ void CEF_CALLBACK web_urlrequest_client_on_data( void CEF_CALLBACK web_urlrequest_client_on_error( struct _cef_web_urlrequest_client_t* self, cef_web_urlrequest_t* requester, - enum cef_handler_errorcode_t errorCode) -{ + enum cef_handler_errorcode_t errorCode) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -163,8 +157,7 @@ void CEF_CALLBACK web_urlrequest_client_on_error( CefWebURLRequestClientCppToC::CefWebURLRequestClientCppToC( CefWebURLRequestClient* cls) : CefCppToC(cls) -{ + cef_web_urlrequest_client_t>(cls) { struct_.struct_.on_state_change = web_urlrequest_client_on_state_change; struct_.struct_.on_redirect = web_urlrequest_client_on_redirect; struct_.struct_.on_headers_received = diff --git a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h index 9a2f2c315..80e599b4d 100644 --- a/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h +++ b/libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _WEBURLREQUESTCLIENT_CPPTOC_H -#define _WEBURLREQUESTCLIENT_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_URLREQUEST_CLIENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_WEB_URLREQUEST_CLIENT_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_web_urlrequest.h" #include "include/capi/cef_web_urlrequest_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefWebURLRequestClientCppToC : public CefCppToC -{ -public: - CefWebURLRequestClientCppToC(CefWebURLRequestClient* cls); + cef_web_urlrequest_client_t> { + public: + explicit CefWebURLRequestClientCppToC(CefWebURLRequestClient* cls); virtual ~CefWebURLRequestClientCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _WEBURLREQUESTCLIENT_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_WEB_URLREQUEST_CLIENT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc b/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc index 3be67c3e3..fc2a0b569 100644 --- a/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc +++ b/libcef_dll/cpptoc/web_urlrequest_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( - cef_request_t* request, struct _cef_web_urlrequest_client_t* client) -{ + cef_request_t* request, struct _cef_web_urlrequest_client_t* client) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: request; type: refptr_same @@ -43,8 +42,7 @@ CEF_EXPORT cef_web_urlrequest_t* cef_web_urlrequest_create( // MEMBER FUNCTIONS - Body may be edited by hand. -void CEF_CALLBACK web_urlrequest_cancel(struct _cef_web_urlrequest_t* self) -{ +void CEF_CALLBACK web_urlrequest_cancel(struct _cef_web_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,8 +54,7 @@ void CEF_CALLBACK web_urlrequest_cancel(struct _cef_web_urlrequest_t* self) } enum cef_weburlrequest_state_t CEF_CALLBACK web_urlrequest_get_state( - struct _cef_web_urlrequest_t* self) -{ + struct _cef_web_urlrequest_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -77,8 +74,7 @@ enum cef_weburlrequest_state_t CEF_CALLBACK web_urlrequest_get_state( CefWebURLRequestCppToC::CefWebURLRequestCppToC(CefWebURLRequest* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.cancel = web_urlrequest_cancel; struct_.struct_.get_state = web_urlrequest_get_state; } diff --git a/libcef_dll/cpptoc/web_urlrequest_cpptoc.h b/libcef_dll/cpptoc/web_urlrequest_cpptoc.h index d515175d6..83e3ee2b9 100644 --- a/libcef_dll/cpptoc/web_urlrequest_cpptoc.h +++ b/libcef_dll/cpptoc/web_urlrequest_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _WEBURLREQUEST_CPPTOC_H -#define _WEBURLREQUEST_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_URLREQUEST_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_WEB_URLREQUEST_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_web_urlrequest.h" #include "include/capi/cef_web_urlrequest_capi.h" @@ -29,13 +30,12 @@ // This class may be instantiated and accessed DLL-side only. class CefWebURLRequestCppToC : public CefCppToC -{ -public: - CefWebURLRequestCppToC(CefWebURLRequest* cls); + cef_web_urlrequest_t> { + public: + explicit CefWebURLRequestCppToC(CefWebURLRequest* cls); virtual ~CefWebURLRequestCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _WEBURLREQUEST_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_WEB_URLREQUEST_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.cc b/libcef_dll/cpptoc/write_handler_cpptoc.cc index 6fc3ee9cb..07df04525 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/write_handler_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, - const void* ptr, size_t size, size_t n) -{ + const void* ptr, size_t size, size_t n) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -39,8 +38,7 @@ size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, } int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, - long offset, int whence) -{ + int64 offset, int whence) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -56,8 +54,7 @@ int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, return _retval; } -long CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) -{ +int64 CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -65,14 +62,13 @@ long CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) return 0; // Execute - long _retval = CefWriteHandlerCppToC::Get(self)->Tell(); + int64 _retval = CefWriteHandlerCppToC::Get(self)->Tell(); // Return type: simple return _retval; } -int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) -{ +int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -91,8 +87,7 @@ int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) CefWriteHandlerCppToC::CefWriteHandlerCppToC(CefWriteHandler* cls) : CefCppToC( - cls) -{ + cls) { struct_.struct_.write = write_handler_write; struct_.struct_.seek = write_handler_seek; struct_.struct_.tell = write_handler_tell; diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.h b/libcef_dll/cpptoc/write_handler_cpptoc.h index 29dd108a5..f0e75a9f6 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.h +++ b/libcef_dll/cpptoc/write_handler_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _WRITEHANDLER_CPPTOC_H -#define _WRITEHANDLER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -25,13 +26,12 @@ // This class may be instantiated and accessed wrapper-side only. class CefWriteHandlerCppToC : public CefCppToC -{ -public: - CefWriteHandlerCppToC(CefWriteHandler* cls); + cef_write_handler_t> { + public: + explicit CefWriteHandlerCppToC(CefWriteHandler* cls); virtual ~CefWriteHandlerCppToC() {} }; -#endif // USING_CEF_SHARED -#endif // _WRITEHANDLER_CPPTOC_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/libcef_dll/cpptoc/xml_reader_cpptoc.cc index a6cb6a15a..a80c32b2e 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, - enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI) -{ + enum cef_xml_encoding_type_t encodingType, const cef_string_t* URI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: stream; type: refptr_same @@ -43,8 +42,7 @@ CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -58,8 +56,7 @@ int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) return _retval; } -int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -73,8 +70,7 @@ int CEF_CALLBACK xml_reader_close(struct _cef_xml_reader_t* self) return _retval; } -int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -89,8 +85,7 @@ int CEF_CALLBACK xml_reader_has_error(struct _cef_xml_reader_t* self) } cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -105,8 +100,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_error( } enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -120,8 +114,7 @@ enum cef_xml_node_type_t CEF_CALLBACK xml_reader_get_type( return _retval; } -int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -136,8 +129,7 @@ int CEF_CALLBACK xml_reader_get_depth(struct _cef_xml_reader_t* self) } cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -152,8 +144,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_local_name( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -168,8 +159,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_prefix( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -184,8 +174,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_qualified_name( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -200,8 +189,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_namespace_uri( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -216,8 +204,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_base_uri( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -231,8 +218,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_xml_lang( return _retval.DetachToUserFree(); } -int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -246,8 +232,7 @@ int CEF_CALLBACK xml_reader_is_empty_element(struct _cef_xml_reader_t* self) return _retval; } -int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -262,8 +247,7 @@ int CEF_CALLBACK xml_reader_has_value(struct _cef_xml_reader_t* self) } cef_string_userfree_t CEF_CALLBACK xml_reader_get_value( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -277,8 +261,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_value( return _retval.DetachToUserFree(); } -int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -293,8 +276,7 @@ int CEF_CALLBACK xml_reader_has_attributes(struct _cef_xml_reader_t* self) } size_t CEF_CALLBACK xml_reader_get_attribute_count( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -309,15 +291,14 @@ size_t CEF_CALLBACK xml_reader_get_attribute_count( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( - struct _cef_xml_reader_t* self, int index) -{ + struct _cef_xml_reader_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return NULL; // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return NULL; @@ -330,8 +311,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byindex( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( - struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) -{ + struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -352,8 +332,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_byqname( cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( struct _cef_xml_reader_t* self, const cef_string_t* localName, - const cef_string_t* namespaceURI) -{ + const cef_string_t* namespaceURI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -378,8 +357,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_attribute_bylname( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -394,8 +372,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_inner_xml( } cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -409,8 +386,7 @@ cef_string_userfree_t CEF_CALLBACK xml_reader_get_outer_xml( return _retval.DetachToUserFree(); } -int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) -{ +int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -425,15 +401,14 @@ int CEF_CALLBACK xml_reader_get_line_number(struct _cef_xml_reader_t* self) } int CEF_CALLBACK xml_reader_move_to_attribute_byindex( - struct _cef_xml_reader_t* self, int index) -{ + struct _cef_xml_reader_t* self, int index) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) return 0; // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return 0; @@ -446,8 +421,7 @@ int CEF_CALLBACK xml_reader_move_to_attribute_byindex( } int CEF_CALLBACK xml_reader_move_to_attribute_byqname( - struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) -{ + struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -468,8 +442,7 @@ int CEF_CALLBACK xml_reader_move_to_attribute_byqname( int CEF_CALLBACK xml_reader_move_to_attribute_bylname( struct _cef_xml_reader_t* self, const cef_string_t* localName, - const cef_string_t* namespaceURI) -{ + const cef_string_t* namespaceURI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -494,8 +467,7 @@ int CEF_CALLBACK xml_reader_move_to_attribute_bylname( } int CEF_CALLBACK xml_reader_move_to_first_attribute( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -510,8 +482,7 @@ int CEF_CALLBACK xml_reader_move_to_first_attribute( } int CEF_CALLBACK xml_reader_move_to_next_attribute( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -526,8 +497,7 @@ int CEF_CALLBACK xml_reader_move_to_next_attribute( } int CEF_CALLBACK xml_reader_move_to_carrying_element( - struct _cef_xml_reader_t* self) -{ + struct _cef_xml_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -545,8 +515,7 @@ int CEF_CALLBACK xml_reader_move_to_carrying_element( // CONSTRUCTOR - Do not edit by hand. CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.move_to_next_node = xml_reader_move_to_next_node; struct_.struct_.close = xml_reader_close; struct_.struct_.has_error = xml_reader_has_error; diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.h b/libcef_dll/cpptoc/xml_reader_cpptoc.h index 86b2e06e8..8d02da2de 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.h +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _XMLREADER_CPPTOC_H -#define _XMLREADER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_xml_reader.h" #include "include/capi/cef_xml_reader_capi.h" @@ -26,13 +27,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefXmlReaderCppToC - : public CefCppToC -{ -public: - CefXmlReaderCppToC(CefXmlReader* cls); + : public CefCppToC { + public: + explicit CefXmlReaderCppToC(CefXmlReader* cls); virtual ~CefXmlReaderCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _XMLREADER_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/libcef_dll/cpptoc/zip_reader_cpptoc.cc index 286560093..57335e96f 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,8 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. -CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(cef_stream_reader_t* stream) -{ +CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( + cef_stream_reader_t* stream) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: stream; type: refptr_same @@ -36,8 +36,7 @@ CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create(cef_stream_reader_t* stream) // MEMBER FUNCTIONS - Body may be edited by hand. -int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) -{ +int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -51,8 +50,7 @@ int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) return _retval; } -int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) -{ +int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -67,8 +65,7 @@ int CEF_CALLBACK zip_reader_move_to_next_file(struct _cef_zip_reader_t* self) } int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, - const cef_string_t* fileName, int caseSensitive) -{ + const cef_string_t* fileName, int caseSensitive) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -88,8 +85,7 @@ int CEF_CALLBACK zip_reader_move_to_file(struct _cef_zip_reader_t* self, return _retval; } -int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) -{ +int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -104,8 +100,7 @@ int CEF_CALLBACK zip_reader_close(struct _cef_zip_reader_t* self) } cef_string_userfree_t CEF_CALLBACK zip_reader_get_file_name( - struct _cef_zip_reader_t* self) -{ + struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -119,8 +114,7 @@ cef_string_userfree_t CEF_CALLBACK zip_reader_get_file_name( return _retval.DetachToUserFree(); } -long CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) -{ +int64 CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -128,15 +122,14 @@ long CEF_CALLBACK zip_reader_get_file_size(struct _cef_zip_reader_t* self) return 0; // Execute - long _retval = CefZipReaderCppToC::Get(self)->GetFileSize(); + int64 _retval = CefZipReaderCppToC::Get(self)->GetFileSize(); // Return type: simple return _retval; } time_t CEF_CALLBACK zip_reader_get_file_last_modified( - struct _cef_zip_reader_t* self) -{ + struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -151,8 +144,7 @@ time_t CEF_CALLBACK zip_reader_get_file_last_modified( } int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, - const cef_string_t* password) -{ + const cef_string_t* password) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -168,8 +160,7 @@ int CEF_CALLBACK zip_reader_open_file(struct _cef_zip_reader_t* self, return _retval; } -int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) -{ +int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -184,8 +175,7 @@ int CEF_CALLBACK zip_reader_close_file(struct _cef_zip_reader_t* self) } int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, - void* buffer, size_t bufferSize) -{ + void* buffer, size_t bufferSize) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -205,8 +195,7 @@ int CEF_CALLBACK zip_reader_read_file(struct _cef_zip_reader_t* self, return _retval; } -long CEF_CALLBACK zip_reader_tell(struct _cef_zip_reader_t* self) -{ +int64 CEF_CALLBACK zip_reader_tell(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -214,14 +203,13 @@ long CEF_CALLBACK zip_reader_tell(struct _cef_zip_reader_t* self) return 0; // Execute - long _retval = CefZipReaderCppToC::Get(self)->Tell(); + int64 _retval = CefZipReaderCppToC::Get(self)->Tell(); // Return type: simple return _retval; } -int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) -{ +int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); @@ -239,8 +227,7 @@ int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) // CONSTRUCTOR - Do not edit by hand. CefZipReaderCppToC::CefZipReaderCppToC(CefZipReader* cls) - : CefCppToC(cls) -{ + : CefCppToC(cls) { struct_.struct_.move_to_first_file = zip_reader_move_to_first_file; struct_.struct_.move_to_next_file = zip_reader_move_to_next_file; struct_.struct_.move_to_file = zip_reader_move_to_file; diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.h b/libcef_dll/cpptoc/zip_reader_cpptoc.h index ec9148473..5e6ab59ca 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.h +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _ZIPREADER_CPPTOC_H -#define _ZIPREADER_CPPTOC_H +#ifndef CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_zip_reader.h" #include "include/capi/cef_zip_reader_capi.h" @@ -26,13 +27,12 @@ // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefZipReaderCppToC - : public CefCppToC -{ -public: - CefZipReaderCppToC(CefZipReader* cls); + : public CefCppToC { + public: + explicit CefZipReaderCppToC(CefZipReader* cls); virtual ~CefZipReaderCppToC() {} }; -#endif // BUILDING_CEF_SHARED -#endif // _ZIPREADER_CPPTOC_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ diff --git a/libcef_dll/ctocpp/app_ctocpp.cc b/libcef_dll/ctocpp/app_ctocpp.cc index b5e5d9c49..c41db438b 100644 --- a/libcef_dll/ctocpp/app_ctocpp.cc +++ b/libcef_dll/ctocpp/app_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -CefRefPtr CefAppCToCpp::GetProxyHandler() -{ +CefRefPtr CefAppCToCpp::GetProxyHandler() { if (CEF_MEMBER_MISSING(struct_, get_proxy_handler)) return NULL; diff --git a/libcef_dll/ctocpp/app_ctocpp.h b/libcef_dll/ctocpp/app_ctocpp.h index 618da37a6..2a3f046e3 100644 --- a/libcef_dll/ctocpp/app_ctocpp.h +++ b/libcef_dll/ctocpp/app_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _APP_CTOCPP_H -#define _APP_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_app.h" #include "include/capi/cef_app_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefAppCToCpp - : public CefCToCpp -{ -public: - CefAppCToCpp(cef_app_t* str) + : public CefCToCpp { + public: + explicit CefAppCToCpp(cef_app_t* str) : CefCToCpp(str) {} virtual ~CefAppCToCpp() {} @@ -35,6 +35,6 @@ public: virtual CefRefPtr GetProxyHandler() OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _APP_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/base_ctocpp.h b/libcef_dll/ctocpp/base_ctocpp.h index 69df2a867..650c08e33 100644 --- a/libcef_dll/ctocpp/base_ctocpp.h +++ b/libcef_dll/ctocpp/base_ctocpp.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _BASE_CTOCPP_H -#define _BASE_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ +#pragma once #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" @@ -11,13 +12,11 @@ // CefCToCpp implementation for CefBase. -class CefBaseCToCpp : public CefBase -{ -public: +class CefBaseCToCpp : public CefBase { + public: // Use this method to create a wrapper class instance for a structure // received from the other side. - static CefRefPtr Wrap(cef_base_t* s) - { + static CefRefPtr Wrap(cef_base_t* s) { if (!s) return NULL; @@ -34,8 +33,7 @@ public: // Use this method to retrieve the underlying structure from a wrapper class // instance for return back to the other side. - static cef_base_t* Unwrap(CefRefPtr c) - { + static cef_base_t* Unwrap(CefRefPtr c) { if (!c.get()) return NULL; @@ -48,9 +46,8 @@ public: return wrapper->GetStruct(); } - CefBaseCToCpp(cef_base_t* str) - : struct_(str) - { + explicit CefBaseCToCpp(cef_base_t* str) + : struct_(str) { DCHECK(str); } virtual ~CefBaseCToCpp() {} @@ -62,13 +59,11 @@ public: // CefBase methods increment/decrement reference counts on both this object // and the underlying wrapped structure. - int AddRef() - { + int AddRef() { UnderlyingAddRef(); return refct_.AddRef(); } - int Release() - { + int Release() { UnderlyingRelease(); int retval = refct_.Release(); if (retval == 0) @@ -78,29 +73,26 @@ public: int GetRefCt() { return refct_.GetRefCt(); } // Increment/decrement reference counts on only the underlying class. - int UnderlyingAddRef() - { - if(!struct_->add_ref) + int UnderlyingAddRef() { + if (!struct_->add_ref) return 0; return struct_->add_ref(struct_); } - int UnderlyingRelease() - { - if(!struct_->release) + int UnderlyingRelease() { + if (!struct_->release) return 0; return struct_->release(struct_); } - int UnderlyingGetRefCt() - { - if(!struct_->get_refct) + int UnderlyingGetRefCt() { + if (!struct_->get_refct) return 0; return struct_->get_refct(struct_); } -protected: + protected: CefRefCount refct_; cef_base_t* struct_; }; -#endif // _BASE_CTOCPP_H +#endif // CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc index 1a04a6cdb..c37bf1798 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, - const CefBrowserSettings& settings) -{ + const CefBrowserSettings& settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: client; type: refptr_diff @@ -43,8 +42,7 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, CefRefPtr CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo, CefRefPtr client, const CefString& url, - const CefBrowserSettings& settings) -{ + const CefBrowserSettings& settings) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: client; type: refptr_diff @@ -67,8 +65,7 @@ CefRefPtr CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo, // VIRTUAL METHODS - Body may be edited by hand. -void CefBrowserCToCpp::ParentWindowWillClose() -{ +void CefBrowserCToCpp::ParentWindowWillClose() { if (CEF_MEMBER_MISSING(struct_, parent_window_will_close)) return; @@ -78,8 +75,7 @@ void CefBrowserCToCpp::ParentWindowWillClose() struct_->parent_window_will_close(struct_); } -void CefBrowserCToCpp::CloseBrowser() -{ +void CefBrowserCToCpp::CloseBrowser() { if (CEF_MEMBER_MISSING(struct_, close_browser)) return; @@ -89,8 +85,7 @@ void CefBrowserCToCpp::CloseBrowser() struct_->close_browser(struct_); } -bool CefBrowserCToCpp::CanGoBack() -{ +bool CefBrowserCToCpp::CanGoBack() { if (CEF_MEMBER_MISSING(struct_, can_go_back)) return false; @@ -103,8 +98,7 @@ bool CefBrowserCToCpp::CanGoBack() return _retval?true:false; } -void CefBrowserCToCpp::GoBack() -{ +void CefBrowserCToCpp::GoBack() { if (CEF_MEMBER_MISSING(struct_, go_back)) return; @@ -114,8 +108,7 @@ void CefBrowserCToCpp::GoBack() struct_->go_back(struct_); } -bool CefBrowserCToCpp::CanGoForward() -{ +bool CefBrowserCToCpp::CanGoForward() { if (CEF_MEMBER_MISSING(struct_, can_go_forward)) return false; @@ -128,8 +121,7 @@ bool CefBrowserCToCpp::CanGoForward() return _retval?true:false; } -void CefBrowserCToCpp::GoForward() -{ +void CefBrowserCToCpp::GoForward() { if (CEF_MEMBER_MISSING(struct_, go_forward)) return; @@ -139,8 +131,7 @@ void CefBrowserCToCpp::GoForward() struct_->go_forward(struct_); } -void CefBrowserCToCpp::Reload() -{ +void CefBrowserCToCpp::Reload() { if (CEF_MEMBER_MISSING(struct_, reload)) return; @@ -150,8 +141,7 @@ void CefBrowserCToCpp::Reload() struct_->reload(struct_); } -void CefBrowserCToCpp::ReloadIgnoreCache() -{ +void CefBrowserCToCpp::ReloadIgnoreCache() { if (CEF_MEMBER_MISSING(struct_, reload_ignore_cache)) return; @@ -161,8 +151,7 @@ void CefBrowserCToCpp::ReloadIgnoreCache() struct_->reload_ignore_cache(struct_); } -void CefBrowserCToCpp::StopLoad() -{ +void CefBrowserCToCpp::StopLoad() { if (CEF_MEMBER_MISSING(struct_, stop_load)) return; @@ -172,8 +161,7 @@ void CefBrowserCToCpp::StopLoad() struct_->stop_load(struct_); } -void CefBrowserCToCpp::SetFocus(bool enable) -{ +void CefBrowserCToCpp::SetFocus(bool enable) { if (CEF_MEMBER_MISSING(struct_, set_focus)) return; @@ -184,8 +172,7 @@ void CefBrowserCToCpp::SetFocus(bool enable) enable); } -CefWindowHandle CefBrowserCToCpp::GetWindowHandle() -{ +CefWindowHandle CefBrowserCToCpp::GetWindowHandle() { if (CEF_MEMBER_MISSING(struct_, get_window_handle)) return NULL; @@ -198,8 +185,7 @@ CefWindowHandle CefBrowserCToCpp::GetWindowHandle() return _retval; } -CefWindowHandle CefBrowserCToCpp::GetOpenerWindowHandle() -{ +CefWindowHandle CefBrowserCToCpp::GetOpenerWindowHandle() { if (CEF_MEMBER_MISSING(struct_, get_opener_window_handle)) return NULL; @@ -212,8 +198,7 @@ CefWindowHandle CefBrowserCToCpp::GetOpenerWindowHandle() return _retval; } -bool CefBrowserCToCpp::IsPopup() -{ +bool CefBrowserCToCpp::IsPopup() { if (CEF_MEMBER_MISSING(struct_, is_popup)) return false; @@ -226,8 +211,7 @@ bool CefBrowserCToCpp::IsPopup() return _retval?true:false; } -bool CefBrowserCToCpp::HasDocument() -{ +bool CefBrowserCToCpp::HasDocument() { if (CEF_MEMBER_MISSING(struct_, has_document)) return false; @@ -240,8 +224,7 @@ bool CefBrowserCToCpp::HasDocument() return _retval?true:false; } -CefRefPtr CefBrowserCToCpp::GetClient() -{ +CefRefPtr CefBrowserCToCpp::GetClient() { if (CEF_MEMBER_MISSING(struct_, get_client)) return NULL; @@ -254,8 +237,7 @@ CefRefPtr CefBrowserCToCpp::GetClient() return CefClientCppToC::Unwrap(_retval); } -CefRefPtr CefBrowserCToCpp::GetMainFrame() -{ +CefRefPtr CefBrowserCToCpp::GetMainFrame() { if (CEF_MEMBER_MISSING(struct_, get_main_frame)) return NULL; @@ -268,8 +250,7 @@ CefRefPtr CefBrowserCToCpp::GetMainFrame() return CefFrameCToCpp::Wrap(_retval); } -CefRefPtr CefBrowserCToCpp::GetFocusedFrame() -{ +CefRefPtr CefBrowserCToCpp::GetFocusedFrame() { if (CEF_MEMBER_MISSING(struct_, get_focused_frame)) return NULL; @@ -282,8 +263,7 @@ CefRefPtr CefBrowserCToCpp::GetFocusedFrame() return CefFrameCToCpp::Wrap(_retval); } -CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) -{ +CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, get_frame)) return NULL; @@ -302,8 +282,7 @@ CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) return CefFrameCToCpp::Wrap(_retval); } -void CefBrowserCToCpp::GetFrameNames(std::vector& names) -{ +void CefBrowserCToCpp::GetFrameNames(std::vector& names) { if (CEF_MEMBER_MISSING(struct_, get_frame_names)) return; @@ -328,8 +307,7 @@ void CefBrowserCToCpp::GetFrameNames(std::vector& names) } void CefBrowserCToCpp::Find(int identifier, const CefString& searchText, - bool forward, bool matchCase, bool findNext) -{ + bool forward, bool matchCase, bool findNext) { if (CEF_MEMBER_MISSING(struct_, find)) return; @@ -349,8 +327,7 @@ void CefBrowserCToCpp::Find(int identifier, const CefString& searchText, findNext); } -void CefBrowserCToCpp::StopFinding(bool clearSelection) -{ +void CefBrowserCToCpp::StopFinding(bool clearSelection) { if (CEF_MEMBER_MISSING(struct_, stop_finding)) return; @@ -361,8 +338,7 @@ void CefBrowserCToCpp::StopFinding(bool clearSelection) clearSelection); } -double CefBrowserCToCpp::GetZoomLevel() -{ +double CefBrowserCToCpp::GetZoomLevel() { if (CEF_MEMBER_MISSING(struct_, get_zoom_level)) return 0; @@ -375,8 +351,7 @@ double CefBrowserCToCpp::GetZoomLevel() return _retval; } -void CefBrowserCToCpp::SetZoomLevel(double zoomLevel) -{ +void CefBrowserCToCpp::SetZoomLevel(double zoomLevel) { if (CEF_MEMBER_MISSING(struct_, set_zoom_level)) return; @@ -387,8 +362,7 @@ void CefBrowserCToCpp::SetZoomLevel(double zoomLevel) zoomLevel); } -void CefBrowserCToCpp::ClearHistory() -{ +void CefBrowserCToCpp::ClearHistory() { if (CEF_MEMBER_MISSING(struct_, clear_history)) return; @@ -398,8 +372,7 @@ void CefBrowserCToCpp::ClearHistory() struct_->clear_history(struct_); } -void CefBrowserCToCpp::ShowDevTools() -{ +void CefBrowserCToCpp::ShowDevTools() { if (CEF_MEMBER_MISSING(struct_, show_dev_tools)) return; @@ -409,8 +382,7 @@ void CefBrowserCToCpp::ShowDevTools() struct_->show_dev_tools(struct_); } -void CefBrowserCToCpp::CloseDevTools() -{ +void CefBrowserCToCpp::CloseDevTools() { if (CEF_MEMBER_MISSING(struct_, close_dev_tools)) return; @@ -420,8 +392,7 @@ void CefBrowserCToCpp::CloseDevTools() struct_->close_dev_tools(struct_); } -bool CefBrowserCToCpp::IsWindowRenderingDisabled() -{ +bool CefBrowserCToCpp::IsWindowRenderingDisabled() { if (CEF_MEMBER_MISSING(struct_, is_window_rendering_disabled)) return false; @@ -434,8 +405,7 @@ bool CefBrowserCToCpp::IsWindowRenderingDisabled() return _retval?true:false; } -bool CefBrowserCToCpp::GetSize(PaintElementType type, int& width, int& height) -{ +bool CefBrowserCToCpp::GetSize(PaintElementType type, int& width, int& height) { if (CEF_MEMBER_MISSING(struct_, get_size)) return false; @@ -451,8 +421,7 @@ bool CefBrowserCToCpp::GetSize(PaintElementType type, int& width, int& height) return _retval?true:false; } -void CefBrowserCToCpp::SetSize(PaintElementType type, int width, int height) -{ +void CefBrowserCToCpp::SetSize(PaintElementType type, int width, int height) { if (CEF_MEMBER_MISSING(struct_, set_size)) return; @@ -465,8 +434,7 @@ void CefBrowserCToCpp::SetSize(PaintElementType type, int width, int height) height); } -bool CefBrowserCToCpp::IsPopupVisible() -{ +bool CefBrowserCToCpp::IsPopupVisible() { if (CEF_MEMBER_MISSING(struct_, is_popup_visible)) return false; @@ -479,8 +447,7 @@ bool CefBrowserCToCpp::IsPopupVisible() return _retval?true:false; } -void CefBrowserCToCpp::HidePopup() -{ +void CefBrowserCToCpp::HidePopup() { if (CEF_MEMBER_MISSING(struct_, hide_popup)) return; @@ -490,8 +457,7 @@ void CefBrowserCToCpp::HidePopup() struct_->hide_popup(struct_); } -void CefBrowserCToCpp::Invalidate(const CefRect& dirtyRect) -{ +void CefBrowserCToCpp::Invalidate(const CefRect& dirtyRect) { if (CEF_MEMBER_MISSING(struct_, invalidate)) return; @@ -503,8 +469,7 @@ void CefBrowserCToCpp::Invalidate(const CefRect& dirtyRect) } bool CefBrowserCToCpp::GetImage(PaintElementType type, int width, int height, - void* buffer) -{ + void* buffer) { if (CEF_MEMBER_MISSING(struct_, get_image)) return false; @@ -527,8 +492,7 @@ bool CefBrowserCToCpp::GetImage(PaintElementType type, int width, int height, } void CefBrowserCToCpp::SendKeyEvent(KeyType type, int key, int modifiers, - bool sysChar, bool imeChar) -{ + bool sysChar, bool imeChar) { if (CEF_MEMBER_MISSING(struct_, send_key_event)) return; @@ -544,8 +508,7 @@ void CefBrowserCToCpp::SendKeyEvent(KeyType type, int key, int modifiers, } void CefBrowserCToCpp::SendMouseClickEvent(int x, int y, MouseButtonType type, - bool mouseUp, int clickCount) -{ + bool mouseUp, int clickCount) { if (CEF_MEMBER_MISSING(struct_, send_mouse_click_event)) return; @@ -560,8 +523,7 @@ void CefBrowserCToCpp::SendMouseClickEvent(int x, int y, MouseButtonType type, clickCount); } -void CefBrowserCToCpp::SendMouseMoveEvent(int x, int y, bool mouseLeave) -{ +void CefBrowserCToCpp::SendMouseMoveEvent(int x, int y, bool mouseLeave) { if (CEF_MEMBER_MISSING(struct_, send_mouse_move_event)) return; @@ -574,8 +536,7 @@ void CefBrowserCToCpp::SendMouseMoveEvent(int x, int y, bool mouseLeave) mouseLeave); } -void CefBrowserCToCpp::SendMouseWheelEvent(int x, int y, int delta) -{ +void CefBrowserCToCpp::SendMouseWheelEvent(int x, int y, int delta) { if (CEF_MEMBER_MISSING(struct_, send_mouse_wheel_event)) return; @@ -588,8 +549,7 @@ void CefBrowserCToCpp::SendMouseWheelEvent(int x, int y, int delta) delta); } -void CefBrowserCToCpp::SendFocusEvent(bool setFocus) -{ +void CefBrowserCToCpp::SendFocusEvent(bool setFocus) { if (CEF_MEMBER_MISSING(struct_, send_focus_event)) return; @@ -600,8 +560,7 @@ void CefBrowserCToCpp::SendFocusEvent(bool setFocus) setFocus); } -void CefBrowserCToCpp::SendCaptureLostEvent() -{ +void CefBrowserCToCpp::SendCaptureLostEvent() { if (CEF_MEMBER_MISSING(struct_, send_capture_lost_event)) return; diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h index 2daf610fd..b0ff458bf 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.h +++ b/libcef_dll/ctocpp/browser_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,13 +10,15 @@ // for more information. // -#ifndef _BROWSER_CTOCPP_H -#define _BROWSER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED +#include #include "include/cef_browser.h" #include "include/capi/cef_browser_capi.h" #include "include/cef_client.h" @@ -28,10 +30,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefBrowserCToCpp - : public CefCToCpp -{ -public: - CefBrowserCToCpp(cef_browser_t* str) + : public CefCToCpp { + public: + explicit CefBrowserCToCpp(cef_browser_t* str) : CefCToCpp(str) {} virtual ~CefBrowserCToCpp() {} @@ -81,6 +82,6 @@ public: virtual void SendCaptureLostEvent() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _BROWSER_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/client_ctocpp.cc b/libcef_dll/ctocpp/client_ctocpp.cc index 7fea3bceb..69cdd97c1 100644 --- a/libcef_dll/ctocpp/client_ctocpp.cc +++ b/libcef_dll/ctocpp/client_ctocpp.cc @@ -29,8 +29,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -CefRefPtr CefClientCToCpp::GetLifeSpanHandler() -{ +CefRefPtr CefClientCToCpp::GetLifeSpanHandler() { if (CEF_MEMBER_MISSING(struct_, get_life_span_handler)) return NULL; @@ -43,8 +42,7 @@ CefRefPtr CefClientCToCpp::GetLifeSpanHandler() return CefLifeSpanHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetLoadHandler() -{ +CefRefPtr CefClientCToCpp::GetLoadHandler() { if (CEF_MEMBER_MISSING(struct_, get_load_handler)) return NULL; @@ -57,8 +55,7 @@ CefRefPtr CefClientCToCpp::GetLoadHandler() return CefLoadHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetRequestHandler() -{ +CefRefPtr CefClientCToCpp::GetRequestHandler() { if (CEF_MEMBER_MISSING(struct_, get_request_handler)) return NULL; @@ -71,8 +68,7 @@ CefRefPtr CefClientCToCpp::GetRequestHandler() return CefRequestHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetDisplayHandler() -{ +CefRefPtr CefClientCToCpp::GetDisplayHandler() { if (CEF_MEMBER_MISSING(struct_, get_display_handler)) return NULL; @@ -85,8 +81,7 @@ CefRefPtr CefClientCToCpp::GetDisplayHandler() return CefDisplayHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetFocusHandler() -{ +CefRefPtr CefClientCToCpp::GetFocusHandler() { if (CEF_MEMBER_MISSING(struct_, get_focus_handler)) return NULL; @@ -99,8 +94,7 @@ CefRefPtr CefClientCToCpp::GetFocusHandler() return CefFocusHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetKeyboardHandler() -{ +CefRefPtr CefClientCToCpp::GetKeyboardHandler() { if (CEF_MEMBER_MISSING(struct_, get_keyboard_handler)) return NULL; @@ -113,8 +107,7 @@ CefRefPtr CefClientCToCpp::GetKeyboardHandler() return CefKeyboardHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetMenuHandler() -{ +CefRefPtr CefClientCToCpp::GetMenuHandler() { if (CEF_MEMBER_MISSING(struct_, get_menu_handler)) return NULL; @@ -127,8 +120,7 @@ CefRefPtr CefClientCToCpp::GetMenuHandler() return CefMenuHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetPermissionHandler() -{ +CefRefPtr CefClientCToCpp::GetPermissionHandler() { if (CEF_MEMBER_MISSING(struct_, get_permission_handler)) return NULL; @@ -141,8 +133,7 @@ CefRefPtr CefClientCToCpp::GetPermissionHandler() return CefPermissionHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetPrintHandler() -{ +CefRefPtr CefClientCToCpp::GetPrintHandler() { if (CEF_MEMBER_MISSING(struct_, get_print_handler)) return NULL; @@ -155,8 +146,7 @@ CefRefPtr CefClientCToCpp::GetPrintHandler() return CefPrintHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetFindHandler() -{ +CefRefPtr CefClientCToCpp::GetFindHandler() { if (CEF_MEMBER_MISSING(struct_, get_find_handler)) return NULL; @@ -169,8 +159,7 @@ CefRefPtr CefClientCToCpp::GetFindHandler() return CefFindHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetJSDialogHandler() -{ +CefRefPtr CefClientCToCpp::GetJSDialogHandler() { if (CEF_MEMBER_MISSING(struct_, get_jsdialog_handler)) return NULL; @@ -183,8 +172,7 @@ CefRefPtr CefClientCToCpp::GetJSDialogHandler() return CefJSDialogHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetV8ContextHandler() -{ +CefRefPtr CefClientCToCpp::GetV8ContextHandler() { if (CEF_MEMBER_MISSING(struct_, get_v8context_handler)) return NULL; @@ -197,8 +185,7 @@ CefRefPtr CefClientCToCpp::GetV8ContextHandler() return CefV8ContextHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetRenderHandler() -{ +CefRefPtr CefClientCToCpp::GetRenderHandler() { if (CEF_MEMBER_MISSING(struct_, get_render_handler)) return NULL; @@ -211,8 +198,7 @@ CefRefPtr CefClientCToCpp::GetRenderHandler() return CefRenderHandlerCToCpp::Wrap(_retval); } -CefRefPtr CefClientCToCpp::GetDragHandler() -{ +CefRefPtr CefClientCToCpp::GetDragHandler() { if (CEF_MEMBER_MISSING(struct_, get_drag_handler)) return NULL; diff --git a/libcef_dll/ctocpp/client_ctocpp.h b/libcef_dll/ctocpp/client_ctocpp.h index 941bacf64..a7ec8f9b4 100644 --- a/libcef_dll/ctocpp/client_ctocpp.h +++ b/libcef_dll/ctocpp/client_ctocpp.h @@ -10,12 +10,13 @@ // for more information. // -#ifndef _CLIENT_CTOCPP_H -#define _CLIENT_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_client.h" #include "include/capi/cef_client_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefClientCToCpp - : public CefCToCpp -{ -public: - CefClientCToCpp(cef_client_t* str) + : public CefCToCpp { + public: + explicit CefClientCToCpp(cef_client_t* str) : CefCToCpp(str) {} virtual ~CefClientCToCpp() {} @@ -48,6 +48,6 @@ public: virtual CefRefPtr GetDragHandler() OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _CLIENT_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/command_line_ctocpp.cc b/libcef_dll/ctocpp/command_line_ctocpp.cc index 0e154d993..7bbc1d313 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.cc +++ b/libcef_dll/ctocpp/command_line_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefCommandLine::CreateCommandLine() -{ +CefRefPtr CefCommandLine::CreateCommandLine() { int build_revision = cef_build_revision(); if (build_revision != CEF_REVISION) { // The libcef build revision does not match the CEF API revision. @@ -38,8 +37,7 @@ CefRefPtr CefCommandLine::CreateCommandLine() // VIRTUAL METHODS - Body may be edited by hand. -void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) -{ +void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) { if (CEF_MEMBER_MISSING(struct_, init_from_argv)) return; @@ -56,8 +54,7 @@ void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) argv); } -void CefCommandLineCToCpp::InitFromString(const CefString& command_line) -{ +void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { if (CEF_MEMBER_MISSING(struct_, init_from_string)) return; @@ -73,8 +70,7 @@ void CefCommandLineCToCpp::InitFromString(const CefString& command_line) command_line.GetStruct()); } -CefString CefCommandLineCToCpp::GetCommandLineString() -{ +CefString CefCommandLineCToCpp::GetCommandLineString() { if (CEF_MEMBER_MISSING(struct_, get_command_line_string)) return CefString(); @@ -89,8 +85,7 @@ CefString CefCommandLineCToCpp::GetCommandLineString() return _retvalStr; } -CefString CefCommandLineCToCpp::GetProgram() -{ +CefString CefCommandLineCToCpp::GetProgram() { if (CEF_MEMBER_MISSING(struct_, get_program)) return CefString(); @@ -105,8 +100,7 @@ CefString CefCommandLineCToCpp::GetProgram() return _retvalStr; } -void CefCommandLineCToCpp::SetProgram(const CefString& program) -{ +void CefCommandLineCToCpp::SetProgram(const CefString& program) { if (CEF_MEMBER_MISSING(struct_, set_program)) return; @@ -122,8 +116,7 @@ void CefCommandLineCToCpp::SetProgram(const CefString& program) program.GetStruct()); } -bool CefCommandLineCToCpp::HasSwitches() -{ +bool CefCommandLineCToCpp::HasSwitches() { if (CEF_MEMBER_MISSING(struct_, has_switches)) return false; @@ -136,8 +129,7 @@ bool CefCommandLineCToCpp::HasSwitches() return _retval?true:false; } -bool CefCommandLineCToCpp::HasSwitch(const CefString& name) -{ +bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, has_switch)) return false; @@ -156,8 +148,7 @@ bool CefCommandLineCToCpp::HasSwitch(const CefString& name) return _retval?true:false; } -CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) -{ +CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, get_switch_value)) return CefString(); @@ -178,8 +169,7 @@ CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) return _retvalStr; } -void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) -{ +void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { if (CEF_MEMBER_MISSING(struct_, get_switches)) return; @@ -203,8 +193,7 @@ void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) } } -void CefCommandLineCToCpp::AppendSwitch(const CefString& name) -{ +void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, append_switch)) return; @@ -221,8 +210,7 @@ void CefCommandLineCToCpp::AppendSwitch(const CefString& name) } void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, - const CefString& value) -{ + const CefString& value) { if (CEF_MEMBER_MISSING(struct_, append_switch_with_value)) return; @@ -243,8 +231,7 @@ void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, value.GetStruct()); } -bool CefCommandLineCToCpp::HasArguments() -{ +bool CefCommandLineCToCpp::HasArguments() { if (CEF_MEMBER_MISSING(struct_, has_arguments)) return false; @@ -257,8 +244,7 @@ bool CefCommandLineCToCpp::HasArguments() return _retval?true:false; } -void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) -{ +void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { if (CEF_MEMBER_MISSING(struct_, get_arguments)) return; @@ -282,8 +268,7 @@ void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) } } -void CefCommandLineCToCpp::AppendArgument(const CefString& argument) -{ +void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { if (CEF_MEMBER_MISSING(struct_, append_argument)) return; diff --git a/libcef_dll/ctocpp/command_line_ctocpp.h b/libcef_dll/ctocpp/command_line_ctocpp.h index c32c5d747..f66c7be1f 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.h +++ b/libcef_dll/ctocpp/command_line_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _COMMANDLINE_CTOCPP_H -#define _COMMANDLINE_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_command_line.h" #include "include/capi/cef_command_line_capi.h" @@ -24,10 +25,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefCommandLineCToCpp - : public CefCToCpp -{ -public: - CefCommandLineCToCpp(cef_command_line_t* str) + : public CefCToCpp { + public: + explicit CefCommandLineCToCpp(cef_command_line_t* str) : CefCToCpp( str) {} virtual ~CefCommandLineCToCpp() {} @@ -50,6 +51,6 @@ public: virtual void AppendArgument(const CefString& argument) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _COMMANDLINE_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/content_filter_ctocpp.cc b/libcef_dll/ctocpp/content_filter_ctocpp.cc index 0c68f05d6..29b1862fc 100644 --- a/libcef_dll/ctocpp/content_filter_ctocpp.cc +++ b/libcef_dll/ctocpp/content_filter_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefContentFilterCToCpp::ProcessData(const void* data, int data_size, - CefRefPtr& substitute_data) -{ + CefRefPtr& substitute_data) { if (CEF_MEMBER_MISSING(struct_, process_data)) return; @@ -31,7 +30,7 @@ void CefContentFilterCToCpp::ProcessData(const void* data, int data_size, // Translate param: substitute_data; type: refptr_diff_byref cef_stream_reader_t* substitute_dataStruct = NULL; - if(substitute_data.get()) + if (substitute_data.get()) substitute_dataStruct = CefStreamReaderCppToC::Wrap(substitute_data); cef_stream_reader_t* substitute_dataOrig = substitute_dataStruct; @@ -51,8 +50,7 @@ void CefContentFilterCToCpp::ProcessData(const void* data, int data_size, } } -void CefContentFilterCToCpp::Drain(CefRefPtr& remainder) -{ +void CefContentFilterCToCpp::Drain(CefRefPtr& remainder) { if (CEF_MEMBER_MISSING(struct_, drain)) return; @@ -60,7 +58,7 @@ void CefContentFilterCToCpp::Drain(CefRefPtr& remainder) // Translate param: remainder; type: refptr_diff_byref cef_stream_reader_t* remainderStruct = NULL; - if(remainder.get()) + if (remainder.get()) remainderStruct = CefStreamReaderCppToC::Wrap(remainder); cef_stream_reader_t* remainderOrig = remainderStruct; diff --git a/libcef_dll/ctocpp/content_filter_ctocpp.h b/libcef_dll/ctocpp/content_filter_ctocpp.h index b37174d46..add5338bc 100644 --- a/libcef_dll/ctocpp/content_filter_ctocpp.h +++ b/libcef_dll/ctocpp/content_filter_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _CONTENTFILTER_CTOCPP_H -#define _CONTENTFILTER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_CONTENT_FILTER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_CONTENT_FILTER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_content_filter.h" #include "include/capi/cef_content_filter_capi.h" @@ -27,10 +28,9 @@ // This class may be instantiated and accessed DLL-side only. class CefContentFilterCToCpp : public CefCToCpp -{ -public: - CefContentFilterCToCpp(cef_content_filter_t* str) + cef_content_filter_t> { + public: + explicit CefContentFilterCToCpp(cef_content_filter_t* str) : CefCToCpp(str) {} virtual ~CefContentFilterCToCpp() {} @@ -41,6 +41,6 @@ public: virtual void Drain(CefRefPtr& remainder) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _CONTENTFILTER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_CONTENT_FILTER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc index 5039e759d..e5d9e4072 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, - int total, bool& deleteCookie) -{ + int total, bool& deleteCookie) { if (CEF_MEMBER_MISSING(struct_, visit)) return false; diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h index ee50b92b5..41969281f 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _COOKIEVISITOR_CTOCPP_H -#define _COOKIEVISITOR_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_cookie.h" #include "include/capi/cef_cookie_capi.h" @@ -25,10 +26,9 @@ // This class may be instantiated and accessed DLL-side only. class CefCookieVisitorCToCpp : public CefCToCpp -{ -public: - CefCookieVisitorCToCpp(cef_cookie_visitor_t* str) + cef_cookie_visitor_t> { + public: + explicit CefCookieVisitorCToCpp(cef_cookie_visitor_t* str) : CefCToCpp(str) {} virtual ~CefCookieVisitorCToCpp() {} @@ -38,6 +38,6 @@ public: bool& deleteCookie) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _COOKIEVISITOR_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/ctocpp.h b/libcef_dll/ctocpp/ctocpp.h index 9f937c58b..3697647c4 100644 --- a/libcef_dll/ctocpp/ctocpp.h +++ b/libcef_dll/ctocpp/ctocpp.h @@ -2,8 +2,9 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _CTOCPP_H -#define _CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ +#pragma once #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" @@ -14,13 +15,11 @@ // exists on the other side of the DLL boundary but will have methods called on // this side of the DLL boundary. template -class CefCToCpp : public BaseName -{ -public: +class CefCToCpp : public BaseName { + public: // Use this method to create a wrapper class instance for a structure // received from the other side. - static CefRefPtr Wrap(StructName* s) - { + static CefRefPtr Wrap(StructName* s) { if (!s) return NULL; @@ -37,8 +36,7 @@ public: // Use this method to retrieve the underlying structure from a wrapper class // instance for return back to the other side. - static StructName* Unwrap(CefRefPtr c) - { + static StructName* Unwrap(CefRefPtr c) { if (!c.get()) return NULL; @@ -51,17 +49,15 @@ public: return wrapper->GetStruct(); } - CefCToCpp(StructName* str) - : struct_(str) - { + explicit CefCToCpp(StructName* str) + : struct_(str) { DCHECK(str); #ifndef NDEBUG CefAtomicIncrement(&DebugObjCt); #endif } - virtual ~CefCToCpp() - { + virtual ~CefCToCpp() { #ifndef NDEBUG CefAtomicDecrement(&DebugObjCt); #endif @@ -74,13 +70,11 @@ public: // CefBase methods increment/decrement reference counts on both this object // and the underlying wrapped structure. - int AddRef() - { + int AddRef() { UnderlyingAddRef(); return refct_.AddRef(); } - int Release() - { + int Release() { UnderlyingRelease(); int retval = refct_.Release(); if (retval == 0) @@ -90,33 +84,30 @@ public: int GetRefCt() { return refct_.GetRefCt(); } // Increment/decrement reference counts on only the underlying class. - int UnderlyingAddRef() - { - if(!struct_->base.add_ref) + int UnderlyingAddRef() { + if (!struct_->base.add_ref) return 0; return struct_->base.add_ref(&struct_->base); } - int UnderlyingRelease() - { - if(!struct_->base.release) + int UnderlyingRelease() { + if (!struct_->base.release) return 0; return struct_->base.release(&struct_->base); } - int UnderlyingGetRefCt() - { - if(!struct_->base.get_refct) + int UnderlyingGetRefCt() { + if (!struct_->base.get_refct) return 0; return struct_->base.get_refct(&struct_->base); } #ifndef NDEBUG // Simple tracking of allocated objects. - static long DebugObjCt; + static long DebugObjCt; // NOLINT(runtime/int) #endif -protected: + protected: CefRefCount refct_; StructName* struct_; }; -#endif // _CTOCPP_H +#endif // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc index eccc34d79..f47b89078 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefDisplayHandlerCToCpp::OnNavStateChange(CefRefPtr browser, - bool canGoBack, bool canGoForward) -{ + bool canGoBack, bool canGoForward) { if (CEF_MEMBER_MISSING(struct_, on_nav_state_change)) return; @@ -38,8 +37,7 @@ void CefDisplayHandlerCToCpp::OnNavStateChange(CefRefPtr browser, } void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, - CefRefPtr frame, const CefString& url) -{ + CefRefPtr frame, const CefString& url) { if (CEF_MEMBER_MISSING(struct_, on_address_change)) return; @@ -67,8 +65,7 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, void CefDisplayHandlerCToCpp::OnContentsSizeChange( CefRefPtr browser, CefRefPtr frame, int width, - int height) -{ + int height) { if (CEF_MEMBER_MISSING(struct_, on_contents_size_change)) return; @@ -92,8 +89,7 @@ void CefDisplayHandlerCToCpp::OnContentsSizeChange( } void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, - const CefString& title) -{ + const CefString& title) { if (CEF_MEMBER_MISSING(struct_, on_title_change)) return; @@ -112,8 +108,7 @@ void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, } bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, - CefString& text) -{ + CefString& text) { if (CEF_MEMBER_MISSING(struct_, on_tooltip)) return false; @@ -135,8 +130,7 @@ bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, } void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, - const CefString& value, StatusType type) -{ + const CefString& value, StatusType type) { if (CEF_MEMBER_MISSING(struct_, on_status_message)) return; @@ -156,8 +150,7 @@ void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, } bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, - const CefString& message, const CefString& source, int line) -{ + const CefString& message, const CefString& source, int line) { if (CEF_MEMBER_MISSING(struct_, on_console_message)) return false; diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h index 76dc09736..85f78aab4 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.h +++ b/libcef_dll/ctocpp/display_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DISPLAYHANDLER_CTOCPP_H -#define _DISPLAYHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_display_handler.h" #include "include/capi/cef_display_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefDisplayHandlerCToCpp : public CefCToCpp -{ -public: - CefDisplayHandlerCToCpp(cef_display_handler_t* str) + cef_display_handler_t> { + public: + explicit CefDisplayHandlerCToCpp(cef_display_handler_t* str) : CefCToCpp(str) {} virtual ~CefDisplayHandlerCToCpp() {} @@ -54,6 +54,6 @@ public: const CefString& message, const CefString& source, int line) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _DISPLAYHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.cc b/libcef_dll/ctocpp/domdocument_ctocpp.cc index cd5d07522..63aeafb67 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.cc +++ b/libcef_dll/ctocpp/domdocument_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() -{ +CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) return DOM_DOCUMENT_TYPE_UNKNOWN; @@ -30,8 +29,7 @@ CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() return _retval; } -CefRefPtr CefDOMDocumentCToCpp::GetDocument() -{ +CefRefPtr CefDOMDocumentCToCpp::GetDocument() { if (CEF_MEMBER_MISSING(struct_, get_document)) return NULL; @@ -44,8 +42,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetDocument() return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMDocumentCToCpp::GetBody() -{ +CefRefPtr CefDOMDocumentCToCpp::GetBody() { if (CEF_MEMBER_MISSING(struct_, get_body)) return NULL; @@ -58,8 +55,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetBody() return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMDocumentCToCpp::GetHead() -{ +CefRefPtr CefDOMDocumentCToCpp::GetHead() { if (CEF_MEMBER_MISSING(struct_, get_head)) return NULL; @@ -72,8 +68,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetHead() return CefDOMNodeCToCpp::Wrap(_retval); } -CefString CefDOMDocumentCToCpp::GetTitle() -{ +CefString CefDOMDocumentCToCpp::GetTitle() { if (CEF_MEMBER_MISSING(struct_, get_title)) return CefString(); @@ -88,8 +83,8 @@ CefString CefDOMDocumentCToCpp::GetTitle() return _retvalStr; } -CefRefPtr CefDOMDocumentCToCpp::GetElementById(const CefString& id) -{ +CefRefPtr CefDOMDocumentCToCpp::GetElementById( + const CefString& id) { if (CEF_MEMBER_MISSING(struct_, get_element_by_id)) return NULL; @@ -108,8 +103,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetElementById(const CefString& id) return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() -{ +CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() { if (CEF_MEMBER_MISSING(struct_, get_focused_node)) return NULL; @@ -122,8 +116,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() return CefDOMNodeCToCpp::Wrap(_retval); } -bool CefDOMDocumentCToCpp::HasSelection() -{ +bool CefDOMDocumentCToCpp::HasSelection() { if (CEF_MEMBER_MISSING(struct_, has_selection)) return false; @@ -136,8 +129,7 @@ bool CefDOMDocumentCToCpp::HasSelection() return _retval?true:false; } -CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() -{ +CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() { if (CEF_MEMBER_MISSING(struct_, get_selection_start_node)) return NULL; @@ -150,8 +142,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() return CefDOMNodeCToCpp::Wrap(_retval); } -int CefDOMDocumentCToCpp::GetSelectionStartOffset() -{ +int CefDOMDocumentCToCpp::GetSelectionStartOffset() { if (CEF_MEMBER_MISSING(struct_, get_selection_start_offset)) return 0; @@ -164,8 +155,7 @@ int CefDOMDocumentCToCpp::GetSelectionStartOffset() return _retval; } -CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() -{ +CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() { if (CEF_MEMBER_MISSING(struct_, get_selection_end_node)) return NULL; @@ -178,8 +168,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() return CefDOMNodeCToCpp::Wrap(_retval); } -int CefDOMDocumentCToCpp::GetSelectionEndOffset() -{ +int CefDOMDocumentCToCpp::GetSelectionEndOffset() { if (CEF_MEMBER_MISSING(struct_, get_selection_end_offset)) return 0; @@ -192,8 +181,7 @@ int CefDOMDocumentCToCpp::GetSelectionEndOffset() return _retval; } -CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() -{ +CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() { if (CEF_MEMBER_MISSING(struct_, get_selection_as_markup)) return CefString(); @@ -208,8 +196,7 @@ CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() return _retvalStr; } -CefString CefDOMDocumentCToCpp::GetSelectionAsText() -{ +CefString CefDOMDocumentCToCpp::GetSelectionAsText() { if (CEF_MEMBER_MISSING(struct_, get_selection_as_text)) return CefString(); @@ -224,8 +211,7 @@ CefString CefDOMDocumentCToCpp::GetSelectionAsText() return _retvalStr; } -CefString CefDOMDocumentCToCpp::GetBaseURL() -{ +CefString CefDOMDocumentCToCpp::GetBaseURL() { if (CEF_MEMBER_MISSING(struct_, get_base_url)) return CefString(); @@ -240,8 +226,7 @@ CefString CefDOMDocumentCToCpp::GetBaseURL() return _retvalStr; } -CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) -{ +CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { if (CEF_MEMBER_MISSING(struct_, get_complete_url)) return CefString(); diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.h b/libcef_dll/ctocpp/domdocument_ctocpp.h index e203cd375..92fc5957d 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.h +++ b/libcef_dll/ctocpp/domdocument_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMDOCUMENT_CTOCPP_H -#define _DOMDOCUMENT_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,10 +25,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefDOMDocumentCToCpp - : public CefCToCpp -{ -public: - CefDOMDocumentCToCpp(cef_domdocument_t* str) + : public CefCToCpp { + public: + explicit CefDOMDocumentCToCpp(cef_domdocument_t* str) : CefCToCpp( str) {} virtual ~CefDOMDocumentCToCpp() {} @@ -51,6 +52,6 @@ public: virtual CefString GetCompleteURL(const CefString& partialURL) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _DOMDOCUMENT_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/domevent_ctocpp.cc b/libcef_dll/ctocpp/domevent_ctocpp.cc index 1611b0ff1..d812312f2 100644 --- a/libcef_dll/ctocpp/domevent_ctocpp.cc +++ b/libcef_dll/ctocpp/domevent_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -CefString CefDOMEventCToCpp::GetType() -{ +CefString CefDOMEventCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) return CefString(); @@ -33,8 +32,7 @@ CefString CefDOMEventCToCpp::GetType() return _retvalStr; } -CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() -{ +CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() { if (CEF_MEMBER_MISSING(struct_, get_category)) return DOM_EVENT_CATEGORY_UNKNOWN; @@ -47,8 +45,7 @@ CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() return _retval; } -CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() -{ +CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() { if (CEF_MEMBER_MISSING(struct_, get_phase)) return DOM_EVENT_PHASE_UNKNOWN; @@ -61,8 +58,7 @@ CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() return _retval; } -bool CefDOMEventCToCpp::CanBubble() -{ +bool CefDOMEventCToCpp::CanBubble() { if (CEF_MEMBER_MISSING(struct_, can_bubble)) return false; @@ -75,8 +71,7 @@ bool CefDOMEventCToCpp::CanBubble() return _retval?true:false; } -bool CefDOMEventCToCpp::CanCancel() -{ +bool CefDOMEventCToCpp::CanCancel() { if (CEF_MEMBER_MISSING(struct_, can_cancel)) return false; @@ -89,8 +84,7 @@ bool CefDOMEventCToCpp::CanCancel() return _retval?true:false; } -CefRefPtr CefDOMEventCToCpp::GetDocument() -{ +CefRefPtr CefDOMEventCToCpp::GetDocument() { if (CEF_MEMBER_MISSING(struct_, get_document)) return NULL; @@ -103,8 +97,7 @@ CefRefPtr CefDOMEventCToCpp::GetDocument() return CefDOMDocumentCToCpp::Wrap(_retval); } -CefRefPtr CefDOMEventCToCpp::GetTarget() -{ +CefRefPtr CefDOMEventCToCpp::GetTarget() { if (CEF_MEMBER_MISSING(struct_, get_target)) return NULL; @@ -117,8 +110,7 @@ CefRefPtr CefDOMEventCToCpp::GetTarget() return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMEventCToCpp::GetCurrentTarget() -{ +CefRefPtr CefDOMEventCToCpp::GetCurrentTarget() { if (CEF_MEMBER_MISSING(struct_, get_current_target)) return NULL; diff --git a/libcef_dll/ctocpp/domevent_ctocpp.h b/libcef_dll/ctocpp/domevent_ctocpp.h index c19fa09d5..64b05c62a 100644 --- a/libcef_dll/ctocpp/domevent_ctocpp.h +++ b/libcef_dll/ctocpp/domevent_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMEVENT_CTOCPP_H -#define _DOMEVENT_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefDOMEventCToCpp - : public CefCToCpp -{ -public: - CefDOMEventCToCpp(cef_domevent_t* str) + : public CefCToCpp { + public: + explicit CefDOMEventCToCpp(cef_domevent_t* str) : CefCToCpp(str) {} virtual ~CefDOMEventCToCpp() {} @@ -42,6 +42,6 @@ public: virtual CefRefPtr GetCurrentTarget() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _DOMEVENT_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/domevent_listener_ctocpp.cc b/libcef_dll/ctocpp/domevent_listener_ctocpp.cc index 56bae320d..3186604b1 100644 --- a/libcef_dll/ctocpp/domevent_listener_ctocpp.cc +++ b/libcef_dll/ctocpp/domevent_listener_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -void CefDOMEventListenerCToCpp::HandleEvent(CefRefPtr event) -{ +void CefDOMEventListenerCToCpp::HandleEvent(CefRefPtr event) { if (CEF_MEMBER_MISSING(struct_, handle_event)) return; diff --git a/libcef_dll/ctocpp/domevent_listener_ctocpp.h b/libcef_dll/ctocpp/domevent_listener_ctocpp.h index d6dbf3dbc..9d90727f3 100644 --- a/libcef_dll/ctocpp/domevent_listener_ctocpp.h +++ b/libcef_dll/ctocpp/domevent_listener_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMEVENTLISTENER_CTOCPP_H -#define _DOMEVENTLISTENER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -25,10 +26,9 @@ // This class may be instantiated and accessed DLL-side only. class CefDOMEventListenerCToCpp : public CefCToCpp -{ -public: - CefDOMEventListenerCToCpp(cef_domevent_listener_t* str) + cef_domevent_listener_t> { + public: + explicit CefDOMEventListenerCToCpp(cef_domevent_listener_t* str) : CefCToCpp(str) {} virtual ~CefDOMEventListenerCToCpp() {} @@ -37,6 +37,6 @@ public: virtual void HandleEvent(CefRefPtr event) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _DOMEVENTLISTENER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/domnode_ctocpp.cc b/libcef_dll/ctocpp/domnode_ctocpp.cc index a262174b1..1dfb6a90c 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.cc +++ b/libcef_dll/ctocpp/domnode_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -CefDOMNode::Type CefDOMNodeCToCpp::GetType() -{ +CefDOMNode::Type CefDOMNodeCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) return DOM_NODE_TYPE_UNSUPPORTED; @@ -32,8 +31,7 @@ CefDOMNode::Type CefDOMNodeCToCpp::GetType() return _retval; } -bool CefDOMNodeCToCpp::IsText() -{ +bool CefDOMNodeCToCpp::IsText() { if (CEF_MEMBER_MISSING(struct_, is_text)) return false; @@ -46,8 +44,7 @@ bool CefDOMNodeCToCpp::IsText() return _retval?true:false; } -bool CefDOMNodeCToCpp::IsElement() -{ +bool CefDOMNodeCToCpp::IsElement() { if (CEF_MEMBER_MISSING(struct_, is_element)) return false; @@ -60,8 +57,7 @@ bool CefDOMNodeCToCpp::IsElement() return _retval?true:false; } -bool CefDOMNodeCToCpp::IsFormControlElement() -{ +bool CefDOMNodeCToCpp::IsFormControlElement() { if (CEF_MEMBER_MISSING(struct_, is_form_control_element)) return false; @@ -74,8 +70,7 @@ bool CefDOMNodeCToCpp::IsFormControlElement() return _retval?true:false; } -CefString CefDOMNodeCToCpp::GetFormControlElementType() -{ +CefString CefDOMNodeCToCpp::GetFormControlElementType() { if (CEF_MEMBER_MISSING(struct_, get_form_control_element_type)) return CefString(); @@ -91,8 +86,7 @@ CefString CefDOMNodeCToCpp::GetFormControlElementType() return _retvalStr; } -bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) -{ +bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) return false; @@ -111,8 +105,7 @@ bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) return _retval?true:false; } -CefString CefDOMNodeCToCpp::GetName() -{ +CefString CefDOMNodeCToCpp::GetName() { if (CEF_MEMBER_MISSING(struct_, get_name)) return CefString(); @@ -127,8 +120,7 @@ CefString CefDOMNodeCToCpp::GetName() return _retvalStr; } -CefString CefDOMNodeCToCpp::GetValue() -{ +CefString CefDOMNodeCToCpp::GetValue() { if (CEF_MEMBER_MISSING(struct_, get_value)) return CefString(); @@ -143,8 +135,7 @@ CefString CefDOMNodeCToCpp::GetValue() return _retvalStr; } -bool CefDOMNodeCToCpp::SetValue(const CefString& value) -{ +bool CefDOMNodeCToCpp::SetValue(const CefString& value) { if (CEF_MEMBER_MISSING(struct_, set_value)) return false; @@ -163,8 +154,7 @@ bool CefDOMNodeCToCpp::SetValue(const CefString& value) return _retval?true:false; } -CefString CefDOMNodeCToCpp::GetAsMarkup() -{ +CefString CefDOMNodeCToCpp::GetAsMarkup() { if (CEF_MEMBER_MISSING(struct_, get_as_markup)) return CefString(); @@ -179,8 +169,7 @@ CefString CefDOMNodeCToCpp::GetAsMarkup() return _retvalStr; } -CefRefPtr CefDOMNodeCToCpp::GetDocument() -{ +CefRefPtr CefDOMNodeCToCpp::GetDocument() { if (CEF_MEMBER_MISSING(struct_, get_document)) return NULL; @@ -193,8 +182,7 @@ CefRefPtr CefDOMNodeCToCpp::GetDocument() return CefDOMDocumentCToCpp::Wrap(_retval); } -CefRefPtr CefDOMNodeCToCpp::GetParent() -{ +CefRefPtr CefDOMNodeCToCpp::GetParent() { if (CEF_MEMBER_MISSING(struct_, get_parent)) return NULL; @@ -207,8 +195,7 @@ CefRefPtr CefDOMNodeCToCpp::GetParent() return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() -{ +CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() { if (CEF_MEMBER_MISSING(struct_, get_previous_sibling)) return NULL; @@ -221,8 +208,7 @@ CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMNodeCToCpp::GetNextSibling() -{ +CefRefPtr CefDOMNodeCToCpp::GetNextSibling() { if (CEF_MEMBER_MISSING(struct_, get_next_sibling)) return NULL; @@ -235,8 +221,7 @@ CefRefPtr CefDOMNodeCToCpp::GetNextSibling() return CefDOMNodeCToCpp::Wrap(_retval); } -bool CefDOMNodeCToCpp::HasChildren() -{ +bool CefDOMNodeCToCpp::HasChildren() { if (CEF_MEMBER_MISSING(struct_, has_children)) return false; @@ -249,8 +234,7 @@ bool CefDOMNodeCToCpp::HasChildren() return _retval?true:false; } -CefRefPtr CefDOMNodeCToCpp::GetFirstChild() -{ +CefRefPtr CefDOMNodeCToCpp::GetFirstChild() { if (CEF_MEMBER_MISSING(struct_, get_first_child)) return NULL; @@ -263,8 +247,7 @@ CefRefPtr CefDOMNodeCToCpp::GetFirstChild() return CefDOMNodeCToCpp::Wrap(_retval); } -CefRefPtr CefDOMNodeCToCpp::GetLastChild() -{ +CefRefPtr CefDOMNodeCToCpp::GetLastChild() { if (CEF_MEMBER_MISSING(struct_, get_last_child)) return NULL; @@ -278,8 +261,7 @@ CefRefPtr CefDOMNodeCToCpp::GetLastChild() } void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType, - CefRefPtr listener, bool useCapture) -{ + CefRefPtr listener, bool useCapture) { if (CEF_MEMBER_MISSING(struct_, add_event_listener)) return; @@ -301,8 +283,7 @@ void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType, useCapture); } -CefString CefDOMNodeCToCpp::GetElementTagName() -{ +CefString CefDOMNodeCToCpp::GetElementTagName() { if (CEF_MEMBER_MISSING(struct_, get_element_tag_name)) return CefString(); @@ -317,8 +298,7 @@ CefString CefDOMNodeCToCpp::GetElementTagName() return _retvalStr; } -bool CefDOMNodeCToCpp::HasElementAttributes() -{ +bool CefDOMNodeCToCpp::HasElementAttributes() { if (CEF_MEMBER_MISSING(struct_, has_element_attributes)) return false; @@ -331,8 +311,7 @@ bool CefDOMNodeCToCpp::HasElementAttributes() return _retval?true:false; } -bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) -{ +bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { if (CEF_MEMBER_MISSING(struct_, has_element_attribute)) return false; @@ -351,8 +330,7 @@ bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) return _retval?true:false; } -CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) -{ +CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { if (CEF_MEMBER_MISSING(struct_, get_element_attribute)) return CefString(); @@ -373,8 +351,7 @@ CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) return _retvalStr; } -void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) -{ +void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { if (CEF_MEMBER_MISSING(struct_, get_element_attributes)) return; @@ -399,8 +376,7 @@ void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) } bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, - const CefString& value) -{ + const CefString& value) { if (CEF_MEMBER_MISSING(struct_, set_element_attribute)) return false; @@ -424,8 +400,7 @@ bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, return _retval?true:false; } -CefString CefDOMNodeCToCpp::GetElementInnerText() -{ +CefString CefDOMNodeCToCpp::GetElementInnerText() { if (CEF_MEMBER_MISSING(struct_, get_element_inner_text)) return CefString(); diff --git a/libcef_dll/ctocpp/domnode_ctocpp.h b/libcef_dll/ctocpp/domnode_ctocpp.h index 8ecc9fdbe..90311251d 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.h +++ b/libcef_dll/ctocpp/domnode_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMNODE_CTOCPP_H -#define _DOMNODE_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefDOMNodeCToCpp - : public CefCToCpp -{ -public: - CefDOMNodeCToCpp(cef_domnode_t* str) + : public CefCToCpp { + public: + explicit CefDOMNodeCToCpp(cef_domnode_t* str) : CefCToCpp(str) {} virtual ~CefDOMNodeCToCpp() {} @@ -61,6 +61,6 @@ public: virtual CefString GetElementInnerText() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _DOMNODE_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/libcef_dll/ctocpp/domvisitor_ctocpp.cc index 5bbdefd5e..b652d633f 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.cc +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -void CefDOMVisitorCToCpp::Visit(CefRefPtr document) -{ +void CefDOMVisitorCToCpp::Visit(CefRefPtr document) { if (CEF_MEMBER_MISSING(struct_, visit)) return; diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.h b/libcef_dll/ctocpp/domvisitor_ctocpp.h index d68b4050d..c2005ff48 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.h +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOMVISITOR_CTOCPP_H -#define _DOMVISITOR_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_dom.h" #include "include/capi/cef_dom_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDOMVisitorCToCpp - : public CefCToCpp -{ -public: - CefDOMVisitorCToCpp(cef_domvisitor_t* str) + : public CefCToCpp { + public: + explicit CefDOMVisitorCToCpp(cef_domvisitor_t* str) : CefCToCpp(str) {} virtual ~CefDOMVisitorCToCpp() {} @@ -35,6 +35,6 @@ public: virtual void Visit(CefRefPtr document) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _DOMVISITOR_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.cc b/libcef_dll/ctocpp/download_handler_ctocpp.cc index d99b90c89..0e1ea6a00 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/download_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -bool CefDownloadHandlerCToCpp::ReceivedData(void* data, int data_size) -{ +bool CefDownloadHandlerCToCpp::ReceivedData(void* data, int data_size) { if (CEF_MEMBER_MISSING(struct_, received_data)) return false; @@ -36,8 +35,7 @@ bool CefDownloadHandlerCToCpp::ReceivedData(void* data, int data_size) return _retval?true:false; } -void CefDownloadHandlerCToCpp::Complete() -{ +void CefDownloadHandlerCToCpp::Complete() { if (CEF_MEMBER_MISSING(struct_, complete)) return; diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.h b/libcef_dll/ctocpp/download_handler_ctocpp.h index 08c6d108a..a12ef9e5e 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.h +++ b/libcef_dll/ctocpp/download_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DOWNLOADHANDLER_CTOCPP_H -#define _DOWNLOADHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_download_handler.h" #include "include/capi/cef_download_handler_capi.h" @@ -25,10 +26,9 @@ // This class may be instantiated and accessed DLL-side only. class CefDownloadHandlerCToCpp : public CefCToCpp -{ -public: - CefDownloadHandlerCToCpp(cef_download_handler_t* str) + cef_download_handler_t> { + public: + explicit CefDownloadHandlerCToCpp(cef_download_handler_t* str) : CefCToCpp(str) {} virtual ~CefDownloadHandlerCToCpp() {} @@ -38,6 +38,6 @@ public: virtual void Complete() OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _DOWNLOADHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.cc b/libcef_dll/ctocpp/drag_data_ctocpp.cc index e702bfb33..f73d18f1d 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_data_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -bool CefDragDataCToCpp::IsLink() -{ +bool CefDragDataCToCpp::IsLink() { if (CEF_MEMBER_MISSING(struct_, is_link)) return false; @@ -30,8 +29,7 @@ bool CefDragDataCToCpp::IsLink() return _retval?true:false; } -bool CefDragDataCToCpp::IsFragment() -{ +bool CefDragDataCToCpp::IsFragment() { if (CEF_MEMBER_MISSING(struct_, is_fragment)) return false; @@ -44,8 +42,7 @@ bool CefDragDataCToCpp::IsFragment() return _retval?true:false; } -bool CefDragDataCToCpp::IsFile() -{ +bool CefDragDataCToCpp::IsFile() { if (CEF_MEMBER_MISSING(struct_, is_file)) return false; @@ -58,8 +55,7 @@ bool CefDragDataCToCpp::IsFile() return _retval?true:false; } -CefString CefDragDataCToCpp::GetLinkURL() -{ +CefString CefDragDataCToCpp::GetLinkURL() { if (CEF_MEMBER_MISSING(struct_, get_link_url)) return CefString(); @@ -74,8 +70,7 @@ CefString CefDragDataCToCpp::GetLinkURL() return _retvalStr; } -CefString CefDragDataCToCpp::GetLinkTitle() -{ +CefString CefDragDataCToCpp::GetLinkTitle() { if (CEF_MEMBER_MISSING(struct_, get_link_title)) return CefString(); @@ -90,8 +85,7 @@ CefString CefDragDataCToCpp::GetLinkTitle() return _retvalStr; } -CefString CefDragDataCToCpp::GetLinkMetadata() -{ +CefString CefDragDataCToCpp::GetLinkMetadata() { if (CEF_MEMBER_MISSING(struct_, get_link_metadata)) return CefString(); @@ -106,8 +100,7 @@ CefString CefDragDataCToCpp::GetLinkMetadata() return _retvalStr; } -CefString CefDragDataCToCpp::GetFragmentText() -{ +CefString CefDragDataCToCpp::GetFragmentText() { if (CEF_MEMBER_MISSING(struct_, get_fragment_text)) return CefString(); @@ -122,8 +115,7 @@ CefString CefDragDataCToCpp::GetFragmentText() return _retvalStr; } -CefString CefDragDataCToCpp::GetFragmentHtml() -{ +CefString CefDragDataCToCpp::GetFragmentHtml() { if (CEF_MEMBER_MISSING(struct_, get_fragment_html)) return CefString(); @@ -138,8 +130,7 @@ CefString CefDragDataCToCpp::GetFragmentHtml() return _retvalStr; } -CefString CefDragDataCToCpp::GetFragmentBaseURL() -{ +CefString CefDragDataCToCpp::GetFragmentBaseURL() { if (CEF_MEMBER_MISSING(struct_, get_fragment_base_url)) return CefString(); @@ -154,8 +145,7 @@ CefString CefDragDataCToCpp::GetFragmentBaseURL() return _retvalStr; } -CefString CefDragDataCToCpp::GetFileExtension() -{ +CefString CefDragDataCToCpp::GetFileExtension() { if (CEF_MEMBER_MISSING(struct_, get_file_extension)) return CefString(); @@ -170,8 +160,7 @@ CefString CefDragDataCToCpp::GetFileExtension() return _retvalStr; } -CefString CefDragDataCToCpp::GetFileName() -{ +CefString CefDragDataCToCpp::GetFileName() { if (CEF_MEMBER_MISSING(struct_, get_file_name)) return CefString(); @@ -186,8 +175,7 @@ CefString CefDragDataCToCpp::GetFileName() return _retvalStr; } -bool CefDragDataCToCpp::GetFileNames(std::vector& names) -{ +bool CefDragDataCToCpp::GetFileNames(std::vector& names) { if (CEF_MEMBER_MISSING(struct_, get_file_names)) return false; diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.h b/libcef_dll/ctocpp/drag_data_ctocpp.h index b29dfb872..d97f1cafd 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.h +++ b/libcef_dll/ctocpp/drag_data_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,13 +10,15 @@ // for more information. // -#ifndef _DRAGDATA_CTOCPP_H -#define _DRAGDATA_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED +#include #include "include/cef_drag_data.h" #include "include/capi/cef_drag_data_capi.h" #include "libcef_dll/ctocpp/ctocpp.h" @@ -24,10 +26,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefDragDataCToCpp - : public CefCToCpp -{ -public: - CefDragDataCToCpp(cef_drag_data_t* str) + : public CefCToCpp { + public: + explicit CefDragDataCToCpp(cef_drag_data_t* str) : CefCToCpp(str) {} virtual ~CefDragDataCToCpp() {} @@ -46,6 +47,6 @@ public: virtual bool GetFileNames(std::vector& names) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _DRAGDATA_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/libcef_dll/ctocpp/drag_handler_ctocpp.cc index fdfd98f36..0d55b1463 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefDragHandlerCToCpp::OnDragStart(CefRefPtr browser, - CefRefPtr dragData, DragOperationsMask mask) -{ + CefRefPtr dragData, DragOperationsMask mask) { if (CEF_MEMBER_MISSING(struct_, on_drag_start)) return false; @@ -45,8 +44,7 @@ bool CefDragHandlerCToCpp::OnDragStart(CefRefPtr browser, } bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, - CefRefPtr dragData, DragOperationsMask mask) -{ + CefRefPtr dragData, DragOperationsMask mask) { if (CEF_MEMBER_MISSING(struct_, on_drag_enter)) return false; diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.h b/libcef_dll/ctocpp/drag_handler_ctocpp.h index 69553d6a6..49f94c5ae 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.h +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _DRAGHANDLER_CTOCPP_H -#define _DRAGHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_drag_handler.h" #include "include/capi/cef_drag_handler_capi.h" @@ -26,10 +27,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefDragHandlerCToCpp - : public CefCToCpp -{ -public: - CefDragHandlerCToCpp(cef_drag_handler_t* str) + : public CefCToCpp { + public: + explicit CefDragHandlerCToCpp(cef_drag_handler_t* str) : CefCToCpp( str) {} virtual ~CefDragHandlerCToCpp() {} @@ -41,6 +42,6 @@ public: CefRefPtr dragData, DragOperationsMask mask) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _DRAGHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.cc b/libcef_dll/ctocpp/find_handler_ctocpp.cc index dec425c4e..e36409e66 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/find_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, - int activeMatchOrdinal, bool finalUpdate) -{ + int activeMatchOrdinal, bool finalUpdate) { if (CEF_MEMBER_MISSING(struct_, on_find_result)) return; diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.h b/libcef_dll/ctocpp/find_handler_ctocpp.h index af46d3a69..be5e23965 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.h +++ b/libcef_dll/ctocpp/find_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _FINDHANDLER_CTOCPP_H -#define _FINDHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_find_handler.h" #include "include/capi/cef_find_handler_capi.h" @@ -26,10 +27,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefFindHandlerCToCpp - : public CefCToCpp -{ -public: - CefFindHandlerCToCpp(cef_find_handler_t* str) + : public CefCToCpp { + public: + explicit CefFindHandlerCToCpp(cef_find_handler_t* str) : CefCToCpp( str) {} virtual ~CefFindHandlerCToCpp() {} @@ -40,6 +41,6 @@ public: bool finalUpdate) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _FINDHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/libcef_dll/ctocpp/focus_handler_ctocpp.cc index e805348d3..60404c6c1 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, - bool next) -{ + bool next) { if (CEF_MEMBER_MISSING(struct_, on_take_focus)) return; @@ -38,8 +37,7 @@ void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, } bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, - FocusSource source) -{ + FocusSource source) { if (CEF_MEMBER_MISSING(struct_, on_set_focus)) return false; @@ -60,8 +58,7 @@ bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, } void CefFocusHandlerCToCpp::OnFocusedNodeChanged(CefRefPtr browser, - CefRefPtr frame, CefRefPtr node) -{ + CefRefPtr frame, CefRefPtr node) { if (CEF_MEMBER_MISSING(struct_, on_focused_node_changed)) return; diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.h b/libcef_dll/ctocpp/focus_handler_ctocpp.h index ec73a142e..e45233c8d 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.h +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _FOCUSHANDLER_CTOCPP_H -#define _FOCUSHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_focus_handler.h" #include "include/capi/cef_focus_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefFocusHandlerCToCpp : public CefCToCpp -{ -public: - CefFocusHandlerCToCpp(cef_focus_handler_t* str) + cef_focus_handler_t> { + public: + explicit CefFocusHandlerCToCpp(cef_focus_handler_t* str) : CefCToCpp( str) {} virtual ~CefFocusHandlerCToCpp() {} @@ -45,6 +45,6 @@ public: CefRefPtr frame, CefRefPtr node) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _FOCUSHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc index d110a5da9..59c47cafa 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.cc +++ b/libcef_dll/ctocpp/frame_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -void CefFrameCToCpp::Undo() -{ +void CefFrameCToCpp::Undo() { if (CEF_MEMBER_MISSING(struct_, undo)) return; @@ -31,8 +30,7 @@ void CefFrameCToCpp::Undo() struct_->undo(struct_); } -void CefFrameCToCpp::Redo() -{ +void CefFrameCToCpp::Redo() { if (CEF_MEMBER_MISSING(struct_, redo)) return; @@ -42,8 +40,7 @@ void CefFrameCToCpp::Redo() struct_->redo(struct_); } -void CefFrameCToCpp::Cut() -{ +void CefFrameCToCpp::Cut() { if (CEF_MEMBER_MISSING(struct_, cut)) return; @@ -53,8 +50,7 @@ void CefFrameCToCpp::Cut() struct_->cut(struct_); } -void CefFrameCToCpp::Copy() -{ +void CefFrameCToCpp::Copy() { if (CEF_MEMBER_MISSING(struct_, copy)) return; @@ -64,8 +60,7 @@ void CefFrameCToCpp::Copy() struct_->copy(struct_); } -void CefFrameCToCpp::Paste() -{ +void CefFrameCToCpp::Paste() { if (CEF_MEMBER_MISSING(struct_, paste)) return; @@ -75,8 +70,7 @@ void CefFrameCToCpp::Paste() struct_->paste(struct_); } -void CefFrameCToCpp::Delete() -{ +void CefFrameCToCpp::Delete() { if (CEF_MEMBER_MISSING(struct_, del)) return; @@ -86,8 +80,7 @@ void CefFrameCToCpp::Delete() struct_->del(struct_); } -void CefFrameCToCpp::SelectAll() -{ +void CefFrameCToCpp::SelectAll() { if (CEF_MEMBER_MISSING(struct_, select_all)) return; @@ -97,8 +90,7 @@ void CefFrameCToCpp::SelectAll() struct_->select_all(struct_); } -void CefFrameCToCpp::Print() -{ +void CefFrameCToCpp::Print() { if (CEF_MEMBER_MISSING(struct_, print)) return; @@ -108,8 +100,7 @@ void CefFrameCToCpp::Print() struct_->print(struct_); } -void CefFrameCToCpp::ViewSource() -{ +void CefFrameCToCpp::ViewSource() { if (CEF_MEMBER_MISSING(struct_, view_source)) return; @@ -119,8 +110,7 @@ void CefFrameCToCpp::ViewSource() struct_->view_source(struct_); } -CefString CefFrameCToCpp::GetSource() -{ +CefString CefFrameCToCpp::GetSource() { if (CEF_MEMBER_MISSING(struct_, get_source)) return CefString(); @@ -135,8 +125,7 @@ CefString CefFrameCToCpp::GetSource() return _retvalStr; } -CefString CefFrameCToCpp::GetText() -{ +CefString CefFrameCToCpp::GetText() { if (CEF_MEMBER_MISSING(struct_, get_text)) return CefString(); @@ -151,8 +140,7 @@ CefString CefFrameCToCpp::GetText() return _retvalStr; } -void CefFrameCToCpp::LoadRequest(CefRefPtr request) -{ +void CefFrameCToCpp::LoadRequest(CefRefPtr request) { if (CEF_MEMBER_MISSING(struct_, load_request)) return; @@ -168,8 +156,7 @@ void CefFrameCToCpp::LoadRequest(CefRefPtr request) CefRequestCToCpp::Unwrap(request)); } -void CefFrameCToCpp::LoadURL(const CefString& url) -{ +void CefFrameCToCpp::LoadURL(const CefString& url) { if (CEF_MEMBER_MISSING(struct_, load_url)) return; @@ -185,16 +172,16 @@ void CefFrameCToCpp::LoadURL(const CefString& url) url.GetStruct()); } -void CefFrameCToCpp::LoadString(const CefString& string, const CefString& url) -{ +void CefFrameCToCpp::LoadString(const CefString& string_val, + const CefString& url) { if (CEF_MEMBER_MISSING(struct_, load_string)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Verify param: string; type: string_byref_const - DCHECK(!string.empty()); - if (string.empty()) + // Verify param: string_val; type: string_byref_const + DCHECK(!string_val.empty()); + if (string_val.empty()) return; // Verify param: url; type: string_byref_const DCHECK(!url.empty()); @@ -203,13 +190,12 @@ void CefFrameCToCpp::LoadString(const CefString& string, const CefString& url) // Execute struct_->load_string(struct_, - string.GetStruct(), + string_val.GetStruct(), url.GetStruct()); } void CefFrameCToCpp::LoadStream(CefRefPtr stream, - const CefString& url) -{ + const CefString& url) { if (CEF_MEMBER_MISSING(struct_, load_stream)) return; @@ -231,8 +217,7 @@ void CefFrameCToCpp::LoadStream(CefRefPtr stream, } void CefFrameCToCpp::ExecuteJavaScript(const CefString& jsCode, - const CefString& scriptUrl, int startLine) -{ + const CefString& scriptUrl, int startLine) { if (CEF_MEMBER_MISSING(struct_, execute_java_script)) return; @@ -251,8 +236,7 @@ void CefFrameCToCpp::ExecuteJavaScript(const CefString& jsCode, startLine); } -bool CefFrameCToCpp::IsMain() -{ +bool CefFrameCToCpp::IsMain() { if (CEF_MEMBER_MISSING(struct_, is_main)) return false; @@ -265,8 +249,7 @@ bool CefFrameCToCpp::IsMain() return _retval?true:false; } -bool CefFrameCToCpp::IsFocused() -{ +bool CefFrameCToCpp::IsFocused() { if (CEF_MEMBER_MISSING(struct_, is_focused)) return false; @@ -279,8 +262,7 @@ bool CefFrameCToCpp::IsFocused() return _retval?true:false; } -CefString CefFrameCToCpp::GetName() -{ +CefString CefFrameCToCpp::GetName() { if (CEF_MEMBER_MISSING(struct_, get_name)) return CefString(); @@ -295,22 +277,20 @@ CefString CefFrameCToCpp::GetName() return _retvalStr; } -long long CefFrameCToCpp::GetIdentifier() -{ +int64 CefFrameCToCpp::GetIdentifier() { if (CEF_MEMBER_MISSING(struct_, get_identifier)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long long _retval = struct_->get_identifier(struct_); + int64 _retval = struct_->get_identifier(struct_); // Return type: simple return _retval; } -CefRefPtr CefFrameCToCpp::GetParent() -{ +CefRefPtr CefFrameCToCpp::GetParent() { if (CEF_MEMBER_MISSING(struct_, get_parent)) return NULL; @@ -323,8 +303,7 @@ CefRefPtr CefFrameCToCpp::GetParent() return CefFrameCToCpp::Wrap(_retval); } -CefString CefFrameCToCpp::GetURL() -{ +CefString CefFrameCToCpp::GetURL() { if (CEF_MEMBER_MISSING(struct_, get_url)) return CefString(); @@ -339,8 +318,7 @@ CefString CefFrameCToCpp::GetURL() return _retvalStr; } -CefRefPtr CefFrameCToCpp::GetBrowser() -{ +CefRefPtr CefFrameCToCpp::GetBrowser() { if (CEF_MEMBER_MISSING(struct_, get_browser)) return NULL; @@ -353,8 +331,7 @@ CefRefPtr CefFrameCToCpp::GetBrowser() return CefBrowserCToCpp::Wrap(_retval); } -void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) -{ +void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { if (CEF_MEMBER_MISSING(struct_, visit_dom)) return; @@ -370,8 +347,7 @@ void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) CefDOMVisitorCppToC::Wrap(visitor)); } -CefRefPtr CefFrameCToCpp::GetV8Context() -{ +CefRefPtr CefFrameCToCpp::GetV8Context() { if (CEF_MEMBER_MISSING(struct_, get_v8context)) return NULL; diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h index e0267af23..bb4995f42 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.h +++ b/libcef_dll/ctocpp/frame_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _FRAME_CTOCPP_H -#define _FRAME_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_frame.h" #include "include/capi/cef_frame_capi.h" @@ -34,10 +35,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefFrameCToCpp - : public CefCToCpp -{ -public: - CefFrameCToCpp(cef_frame_t* str) + : public CefCToCpp { + public: + explicit CefFrameCToCpp(cef_frame_t* str) : CefCToCpp(str) {} virtual ~CefFrameCToCpp() {} @@ -55,7 +55,7 @@ public: virtual CefString GetText() OVERRIDE; virtual void LoadRequest(CefRefPtr request) OVERRIDE; virtual void LoadURL(const CefString& url) OVERRIDE; - virtual void LoadString(const CefString& string, + virtual void LoadString(const CefString& string_val, const CefString& url) OVERRIDE; virtual void LoadStream(CefRefPtr stream, const CefString& url) OVERRIDE; @@ -64,7 +64,7 @@ public: virtual bool IsMain() OVERRIDE; virtual bool IsFocused() OVERRIDE; virtual CefString GetName() OVERRIDE; - virtual long long GetIdentifier() OVERRIDE; + virtual int64 GetIdentifier() OVERRIDE; virtual CefRefPtr GetParent() OVERRIDE; virtual CefString GetURL() OVERRIDE; virtual CefRefPtr GetBrowser() OVERRIDE; @@ -72,6 +72,6 @@ public: virtual CefRefPtr GetV8Context() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _FRAME_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc index c7446aec8..41f45f0ba 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefJSDialogHandlerCToCpp::OnJSAlert(CefRefPtr browser, - CefRefPtr frame, const CefString& message) -{ + CefRefPtr frame, const CefString& message) { if (CEF_MEMBER_MISSING(struct_, on_jsalert)) return false; @@ -49,8 +48,7 @@ bool CefJSDialogHandlerCToCpp::OnJSAlert(CefRefPtr browser, } bool CefJSDialogHandlerCToCpp::OnJSConfirm(CefRefPtr browser, - CefRefPtr frame, const CefString& message, bool& retval) -{ + CefRefPtr frame, const CefString& message, bool& retval) { if (CEF_MEMBER_MISSING(struct_, on_jsconfirm)) return false; @@ -88,8 +86,7 @@ bool CefJSDialogHandlerCToCpp::OnJSConfirm(CefRefPtr browser, bool CefJSDialogHandlerCToCpp::OnJSPrompt(CefRefPtr browser, CefRefPtr frame, const CefString& message, - const CefString& defaultValue, bool& retval, CefString& result) -{ + const CefString& defaultValue, bool& retval, CefString& result) { if (CEF_MEMBER_MISSING(struct_, on_jsprompt)) return false; diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h index 96d8f8c9c..e9f24a41f 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _JSDIALOGHANDLER_CTOCPP_H -#define _JSDIALOGHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_jsdialog_handler.h" #include "include/capi/cef_jsdialog_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefJSDialogHandlerCToCpp : public CefCToCpp -{ -public: - CefJSDialogHandlerCToCpp(cef_jsdialog_handler_t* str) + cef_jsdialog_handler_t> { + public: + explicit CefJSDialogHandlerCToCpp(cef_jsdialog_handler_t* str) : CefCToCpp(str) {} virtual ~CefJSDialogHandlerCToCpp() {} @@ -49,6 +49,6 @@ public: CefString& result) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _JSDIALOGHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc index 0ab25a3fb..b49457d2e 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, KeyEventType type, int code, int modifiers, bool isSystemKey, - bool isAfterJavaScript) -{ + bool isAfterJavaScript) { if (CEF_MEMBER_MISSING(struct_, on_key_event)) return false; diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h index 7db185105..ee6a1c402 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _KEYBOARDHANDLER_CTOCPP_H -#define _KEYBOARDHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_keyboard_handler.h" #include "include/capi/cef_keyboard_handler_capi.h" @@ -27,10 +28,9 @@ // This class may be instantiated and accessed DLL-side only. class CefKeyboardHandlerCToCpp : public CefCToCpp -{ -public: - CefKeyboardHandlerCToCpp(cef_keyboard_handler_t* str) + cef_keyboard_handler_t> { + public: + explicit CefKeyboardHandlerCToCpp(cef_keyboard_handler_t* str) : CefCToCpp(str) {} virtual ~CefKeyboardHandlerCToCpp() {} @@ -41,6 +41,6 @@ public: bool isAfterJavaScript) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _KEYBOARDHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc index 09a04d587..4db810135 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup( CefRefPtr parentBrowser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, const CefString& url, - CefRefPtr& client, CefBrowserSettings& settings) -{ + CefRefPtr& client, CefBrowserSettings& settings) { if (CEF_MEMBER_MISSING(struct_, on_before_popup)) return false; @@ -35,7 +34,7 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup( // Translate param: client; type: refptr_same_byref cef_client_t* clientStruct = NULL; - if(client.get()) + if (client.get()) clientStruct = CefClientCToCpp::Unwrap(client); cef_client_t* clientOrig = clientStruct; @@ -61,8 +60,7 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup( return _retval?true:false; } -void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) -{ +void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, on_after_created)) return; @@ -78,8 +76,7 @@ void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) CefBrowserCppToC::Wrap(browser)); } -bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) -{ +bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, run_modal)) return false; @@ -98,8 +95,7 @@ bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) return _retval?true:false; } -bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) -{ +bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, do_close)) return false; @@ -118,8 +114,7 @@ bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) return _retval?true:false; } -void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) -{ +void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { if (CEF_MEMBER_MISSING(struct_, on_before_close)) return; diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/libcef_dll/ctocpp/life_span_handler_ctocpp.h index def3a2af5..e8657b019 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.h +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _LIFESPANHANDLER_CTOCPP_H -#define _LIFESPANHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_life_span_handler.h" #include "include/capi/cef_life_span_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefLifeSpanHandlerCToCpp : public CefCToCpp -{ -public: - CefLifeSpanHandlerCToCpp(cef_life_span_handler_t* str) + cef_life_span_handler_t> { + public: + explicit CefLifeSpanHandlerCToCpp(cef_life_span_handler_t* str) : CefCToCpp(str) {} virtual ~CefLifeSpanHandlerCToCpp() {} @@ -48,6 +48,6 @@ public: virtual void OnBeforeClose(CefRefPtr browser) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _LIFESPANHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.cc b/libcef_dll/ctocpp/load_handler_ctocpp.cc index dbfcd8c74..642cd7de0 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/load_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, - CefRefPtr frame) -{ + CefRefPtr frame) { if (CEF_MEMBER_MISSING(struct_, on_load_start)) return; @@ -41,8 +40,7 @@ void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, } void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, - CefRefPtr frame, int httpStatusCode) -{ + CefRefPtr frame, int httpStatusCode) { if (CEF_MEMBER_MISSING(struct_, on_load_end)) return; @@ -66,8 +64,7 @@ void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, bool CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& failedUrl, - CefString& errorText) -{ + CefString& errorText) { if (CEF_MEMBER_MISSING(struct_, on_load_error)) return false; diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.h b/libcef_dll/ctocpp/load_handler_ctocpp.h index 48c021a9a..0ceb655df 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.h +++ b/libcef_dll/ctocpp/load_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _LOADHANDLER_CTOCPP_H -#define _LOADHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_load_handler.h" #include "include/capi/cef_load_handler_capi.h" @@ -28,10 +29,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefLoadHandlerCToCpp - : public CefCToCpp -{ -public: - CefLoadHandlerCToCpp(cef_load_handler_t* str) + : public CefCToCpp { + public: + explicit CefLoadHandlerCToCpp(cef_load_handler_t* str) : CefCToCpp( str) {} virtual ~CefLoadHandlerCToCpp() {} @@ -46,6 +47,6 @@ public: const CefString& failedUrl, CefString& errorText) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _LOADHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/menu_handler_ctocpp.cc b/libcef_dll/ctocpp/menu_handler_ctocpp.cc index 62ae9db09..585d87d84 100644 --- a/libcef_dll/ctocpp/menu_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/menu_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefMenuHandlerCToCpp::OnBeforeMenu(CefRefPtr browser, - const CefMenuInfo& menuInfo) -{ + const CefMenuInfo& menuInfo) { if (CEF_MEMBER_MISSING(struct_, on_before_menu)) return false; @@ -39,8 +38,7 @@ bool CefMenuHandlerCToCpp::OnBeforeMenu(CefRefPtr browser, } void CefMenuHandlerCToCpp::GetMenuLabel(CefRefPtr browser, - MenuId menuId, CefString& label) -{ + MenuId menuId, CefString& label) { if (CEF_MEMBER_MISSING(struct_, get_menu_label)) return; @@ -59,8 +57,7 @@ void CefMenuHandlerCToCpp::GetMenuLabel(CefRefPtr browser, } bool CefMenuHandlerCToCpp::OnMenuAction(CefRefPtr browser, - MenuId menuId) -{ + MenuId menuId) { if (CEF_MEMBER_MISSING(struct_, on_menu_action)) return false; diff --git a/libcef_dll/ctocpp/menu_handler_ctocpp.h b/libcef_dll/ctocpp/menu_handler_ctocpp.h index 5dcf50d5d..31f74c6f8 100644 --- a/libcef_dll/ctocpp/menu_handler_ctocpp.h +++ b/libcef_dll/ctocpp/menu_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _MENUHANDLER_CTOCPP_H -#define _MENUHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_MENU_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_menu_handler.h" #include "include/capi/cef_menu_handler_capi.h" @@ -26,10 +27,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefMenuHandlerCToCpp - : public CefCToCpp -{ -public: - CefMenuHandlerCToCpp(cef_menu_handler_t* str) + : public CefCToCpp { + public: + explicit CefMenuHandlerCToCpp(cef_menu_handler_t* str) : CefCToCpp( str) {} virtual ~CefMenuHandlerCToCpp() {} @@ -43,6 +44,6 @@ public: MenuId menuId) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _MENUHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_MENU_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/permission_handler_ctocpp.cc b/libcef_dll/ctocpp/permission_handler_ctocpp.cc index ce8d356b4..700e91b39 100644 --- a/libcef_dll/ctocpp/permission_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/permission_handler_ctocpp.cc @@ -19,8 +19,7 @@ bool CefPermissionHandlerCToCpp::OnBeforeScriptExtensionLoad( CefRefPtr browser, CefRefPtr frame, - const CefString& extensionName) -{ + const CefString& extensionName) { if (CEF_MEMBER_MISSING(struct_, on_before_script_extension_load)) return false; diff --git a/libcef_dll/ctocpp/permission_handler_ctocpp.h b/libcef_dll/ctocpp/permission_handler_ctocpp.h index 6a6dd6e58..0bffa2a81 100644 --- a/libcef_dll/ctocpp/permission_handler_ctocpp.h +++ b/libcef_dll/ctocpp/permission_handler_ctocpp.h @@ -10,12 +10,13 @@ // for more information. // -#ifndef _PERMISSIONHANDLER_CTOCPP_H -#define _PERMISSIONHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_PERMISSION_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PERMISSION_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_permission_handler.h" #include "include/capi/cef_permission_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefPermissionHandlerCToCpp : public CefCToCpp -{ -public: - CefPermissionHandlerCToCpp(cef_permission_handler_t* str) + cef_permission_handler_t> { + public: + explicit CefPermissionHandlerCToCpp(cef_permission_handler_t* str) : CefCToCpp(str) {} virtual ~CefPermissionHandlerCToCpp() {} @@ -42,6 +42,6 @@ public: CefRefPtr frame, const CefString& extensionName) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _PERMISSIONHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PERMISSION_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/post_data_ctocpp.cc b/libcef_dll/ctocpp/post_data_ctocpp.cc index fdfaadc78..0a0c593cf 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefPostData::CreatePostData() -{ +CefRefPtr CefPostData::CreatePostData() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -30,8 +29,7 @@ CefRefPtr CefPostData::CreatePostData() // VIRTUAL METHODS - Body may be edited by hand. -size_t CefPostDataCToCpp::GetElementCount() -{ +size_t CefPostDataCToCpp::GetElementCount() { if (CEF_MEMBER_MISSING(struct_, get_element_count)) return 0; @@ -44,8 +42,7 @@ size_t CefPostDataCToCpp::GetElementCount() return _retval; } -void CefPostDataCToCpp::GetElements(ElementVector& elements) -{ +void CefPostDataCToCpp::GetElements(ElementVector& elements) { if (CEF_MEMBER_MISSING(struct_, get_elements)) return; @@ -83,8 +80,7 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) } } -bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) -{ +bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { if (CEF_MEMBER_MISSING(struct_, remove_element)) return false; @@ -103,8 +99,7 @@ bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) return _retval?true:false; } -bool CefPostDataCToCpp::AddElement(CefRefPtr element) -{ +bool CefPostDataCToCpp::AddElement(CefRefPtr element) { if (CEF_MEMBER_MISSING(struct_, add_element)) return false; @@ -123,8 +118,7 @@ bool CefPostDataCToCpp::AddElement(CefRefPtr element) return _retval?true:false; } -void CefPostDataCToCpp::RemoveElements() -{ +void CefPostDataCToCpp::RemoveElements() { if (CEF_MEMBER_MISSING(struct_, remove_elements)) return; diff --git a/libcef_dll/ctocpp/post_data_ctocpp.h b/libcef_dll/ctocpp/post_data_ctocpp.h index 722f94252..505980dfd 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _POSTDATA_CTOCPP_H -#define _POSTDATA_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_request.h" #include "include/capi/cef_request_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefPostDataCToCpp - : public CefCToCpp -{ -public: - CefPostDataCToCpp(cef_post_data_t* str) + : public CefCToCpp { + public: + explicit CefPostDataCToCpp(cef_post_data_t* str) : CefCToCpp(str) {} virtual ~CefPostDataCToCpp() {} @@ -39,6 +39,6 @@ public: virtual void RemoveElements() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _POSTDATA_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/libcef_dll/ctocpp/post_data_element_ctocpp.cc index 43701816f..b931ecbca 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefPostDataElement::CreatePostDataElement() -{ +CefRefPtr CefPostDataElement::CreatePostDataElement() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -29,8 +28,7 @@ CefRefPtr CefPostDataElement::CreatePostDataElement() // VIRTUAL METHODS - Body may be edited by hand. -void CefPostDataElementCToCpp::SetToEmpty() -{ +void CefPostDataElementCToCpp::SetToEmpty() { if (CEF_MEMBER_MISSING(struct_, set_to_empty)) return; @@ -40,8 +38,7 @@ void CefPostDataElementCToCpp::SetToEmpty() struct_->set_to_empty(struct_); } -void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) -{ +void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { if (CEF_MEMBER_MISSING(struct_, set_to_file)) return; @@ -57,8 +54,7 @@ void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) fileName.GetStruct()); } -void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) -{ +void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { if (CEF_MEMBER_MISSING(struct_, set_to_bytes)) return; @@ -75,8 +71,7 @@ void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) bytes); } -CefPostDataElement::Type CefPostDataElementCToCpp::GetType() -{ +CefPostDataElement::Type CefPostDataElementCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) return PDE_TYPE_EMPTY; @@ -89,8 +84,7 @@ CefPostDataElement::Type CefPostDataElementCToCpp::GetType() return _retval; } -CefString CefPostDataElementCToCpp::GetFile() -{ +CefString CefPostDataElementCToCpp::GetFile() { if (CEF_MEMBER_MISSING(struct_, get_file)) return CefString(); @@ -105,8 +99,7 @@ CefString CefPostDataElementCToCpp::GetFile() return _retvalStr; } -size_t CefPostDataElementCToCpp::GetBytesCount() -{ +size_t CefPostDataElementCToCpp::GetBytesCount() { if (CEF_MEMBER_MISSING(struct_, get_bytes_count)) return 0; @@ -119,8 +112,7 @@ size_t CefPostDataElementCToCpp::GetBytesCount() return _retval; } -size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) -{ +size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { if (CEF_MEMBER_MISSING(struct_, get_bytes)) return 0; diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.h b/libcef_dll/ctocpp/post_data_element_ctocpp.h index 95754d7d2..2840dbdbd 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _POSTDATAELEMENT_CTOCPP_H -#define _POSTDATAELEMENT_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_request.h" #include "include/capi/cef_request_capi.h" @@ -25,10 +26,9 @@ // This class may be instantiated and accessed wrapper-side only. class CefPostDataElementCToCpp : public CefCToCpp -{ -public: - CefPostDataElementCToCpp(cef_post_data_element_t* str) + cef_post_data_element_t> { + public: + explicit CefPostDataElementCToCpp(cef_post_data_element_t* str) : CefCToCpp(str) {} virtual ~CefPostDataElementCToCpp() {} @@ -43,6 +43,6 @@ public: virtual size_t GetBytes(size_t size, void* bytes) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _POSTDATAELEMENT_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.cc b/libcef_dll/ctocpp/print_handler_ctocpp.cc index f34e653d2..81ae2a702 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/print_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefPrintHandlerCToCpp::GetPrintOptions(CefRefPtr browser, - CefPrintOptions& printOptions) -{ + CefPrintOptions& printOptions) { if (CEF_MEMBER_MISSING(struct_, get_print_options)) return false; @@ -44,8 +43,7 @@ bool CefPrintHandlerCToCpp::GetPrintHeaderFooter(CefRefPtr browser, const CefString& url, const CefString& title, int currentPage, int maxPages, CefString& topLeft, CefString& topCenter, CefString& topRight, CefString& bottomLeft, CefString& bottomCenter, - CefString& bottomRight) -{ + CefString& bottomRight) { if (CEF_MEMBER_MISSING(struct_, get_print_header_footer)) return false; diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.h b/libcef_dll/ctocpp/print_handler_ctocpp.h index a78bf9632..042701fe0 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.h +++ b/libcef_dll/ctocpp/print_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _PRINTHANDLER_CTOCPP_H -#define _PRINTHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_print_handler.h" #include "include/capi/cef_print_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefPrintHandlerCToCpp : public CefCToCpp -{ -public: - CefPrintHandlerCToCpp(cef_print_handler_t* str) + cef_print_handler_t> { + public: + explicit CefPrintHandlerCToCpp(cef_print_handler_t* str) : CefCToCpp( str) {} virtual ~CefPrintHandlerCToCpp() {} @@ -48,6 +48,6 @@ public: CefString& bottomRight) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _PRINTHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/proxy_handler_ctocpp.cc b/libcef_dll/ctocpp/proxy_handler_ctocpp.cc index eadc974e5..bdb490cea 100644 --- a/libcef_dll/ctocpp/proxy_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/proxy_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefProxyHandlerCToCpp::GetProxyForUrl(const CefString& url, - CefProxyInfo& proxy_info) -{ + CefProxyInfo& proxy_info) { if (CEF_MEMBER_MISSING(struct_, get_proxy_for_url)) return; diff --git a/libcef_dll/ctocpp/proxy_handler_ctocpp.h b/libcef_dll/ctocpp/proxy_handler_ctocpp.h index d01c0f73c..bf37ee4cd 100644 --- a/libcef_dll/ctocpp/proxy_handler_ctocpp.h +++ b/libcef_dll/ctocpp/proxy_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _PROXYHANDLER_CTOCPP_H -#define _PROXYHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_PROXY_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PROXY_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_proxy_handler.h" #include "include/capi/cef_proxy_handler_capi.h" @@ -25,10 +26,9 @@ // This class may be instantiated and accessed DLL-side only. class CefProxyHandlerCToCpp : public CefCToCpp -{ -public: - CefProxyHandlerCToCpp(cef_proxy_handler_t* str) + cef_proxy_handler_t> { + public: + explicit CefProxyHandlerCToCpp(cef_proxy_handler_t* str) : CefCToCpp( str) {} virtual ~CefProxyHandlerCToCpp() {} @@ -38,6 +38,6 @@ public: CefProxyInfo& proxy_info) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _PROXYHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PROXY_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.cc b/libcef_dll/ctocpp/read_handler_ctocpp.cc index 7ec7adff4..483b8699f 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/read_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) -{ +size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { if (CEF_MEMBER_MISSING(struct_, read)) return 0; @@ -37,8 +36,7 @@ size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) return _retval; } -int CefReadHandlerCToCpp::Seek(long offset, int whence) -{ +int CefReadHandlerCToCpp::Seek(int64 offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) return 0; @@ -53,22 +51,20 @@ int CefReadHandlerCToCpp::Seek(long offset, int whence) return _retval; } -long CefReadHandlerCToCpp::Tell() -{ +int64 CefReadHandlerCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long _retval = struct_->tell(struct_); + int64 _retval = struct_->tell(struct_); // Return type: simple return _retval; } -int CefReadHandlerCToCpp::Eof() -{ +int CefReadHandlerCToCpp::Eof() { if (CEF_MEMBER_MISSING(struct_, eof)) return 0; diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.h b/libcef_dll/ctocpp/read_handler_ctocpp.h index 349a86078..6e56c44b5 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.h +++ b/libcef_dll/ctocpp/read_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _READHANDLER_CTOCPP_H -#define _READHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -24,21 +25,21 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefReadHandlerCToCpp - : public CefCToCpp -{ -public: - CefReadHandlerCToCpp(cef_read_handler_t* str) + : public CefCToCpp { + public: + explicit CefReadHandlerCToCpp(cef_read_handler_t* str) : CefCToCpp( str) {} virtual ~CefReadHandlerCToCpp() {} // CefReadHandler methods virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Eof() OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _READHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc index 73d82f5ef..a0d06dfb5 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, - CefRect& rect) -{ + CefRect& rect) { if (CEF_MEMBER_MISSING(struct_, get_view_rect)) return false; @@ -39,8 +38,7 @@ bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, } bool CefRenderHandlerCToCpp::GetScreenRect(CefRefPtr browser, - CefRect& rect) -{ + CefRect& rect) { if (CEF_MEMBER_MISSING(struct_, get_screen_rect)) return false; @@ -61,8 +59,7 @@ bool CefRenderHandlerCToCpp::GetScreenRect(CefRefPtr browser, } bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, - int viewX, int viewY, int& screenX, int& screenY) -{ + int viewX, int viewY, int& screenX, int& screenY) { if (CEF_MEMBER_MISSING(struct_, get_screen_point)) return false; @@ -86,8 +83,7 @@ bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, } void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, - bool show) -{ + bool show) { if (CEF_MEMBER_MISSING(struct_, on_popup_show)) return; @@ -105,8 +101,7 @@ void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, } void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, - const CefRect& rect) -{ + const CefRect& rect) { if (CEF_MEMBER_MISSING(struct_, on_popup_size)) return; @@ -124,8 +119,7 @@ void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, } void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, - PaintElementType type, const RectList& dirtyRects, const void* buffer) -{ + PaintElementType type, const RectList& dirtyRects, const void* buffer) { if (CEF_MEMBER_MISSING(struct_, on_paint)) return; @@ -163,8 +157,7 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, } void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, - CefCursorHandle cursor) -{ + CefCursorHandle cursor) { if (CEF_MEMBER_MISSING(struct_, on_cursor_change)) return; diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h index d15fa0c9c..86933c8cf 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _RENDERHANDLER_CTOCPP_H -#define _RENDERHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_render_handler.h" #include "include/capi/cef_render_handler_capi.h" @@ -27,10 +28,9 @@ // This class may be instantiated and accessed DLL-side only. class CefRenderHandlerCToCpp : public CefCToCpp -{ -public: - CefRenderHandlerCToCpp(cef_render_handler_t* str) + cef_render_handler_t> { + public: + explicit CefRenderHandlerCToCpp(cef_render_handler_t* str) : CefCToCpp(str) {} virtual ~CefRenderHandlerCToCpp() {} @@ -51,6 +51,6 @@ public: CefCursorHandle cursor) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _RENDERHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/request_ctocpp.cc b/libcef_dll/ctocpp/request_ctocpp.cc index 73e61f3f9..e34c508ea 100644 --- a/libcef_dll/ctocpp/request_ctocpp.cc +++ b/libcef_dll/ctocpp/request_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefRequest::CreateRequest() -{ +CefRefPtr CefRequest::CreateRequest() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -31,8 +30,7 @@ CefRefPtr CefRequest::CreateRequest() // VIRTUAL METHODS - Body may be edited by hand. -CefString CefRequestCToCpp::GetURL() -{ +CefString CefRequestCToCpp::GetURL() { if (CEF_MEMBER_MISSING(struct_, get_url)) return CefString(); @@ -47,8 +45,7 @@ CefString CefRequestCToCpp::GetURL() return _retvalStr; } -void CefRequestCToCpp::SetURL(const CefString& url) -{ +void CefRequestCToCpp::SetURL(const CefString& url) { if (CEF_MEMBER_MISSING(struct_, set_url)) return; @@ -64,8 +61,7 @@ void CefRequestCToCpp::SetURL(const CefString& url) url.GetStruct()); } -CefString CefRequestCToCpp::GetMethod() -{ +CefString CefRequestCToCpp::GetMethod() { if (CEF_MEMBER_MISSING(struct_, get_method)) return CefString(); @@ -80,8 +76,7 @@ CefString CefRequestCToCpp::GetMethod() return _retvalStr; } -void CefRequestCToCpp::SetMethod(const CefString& method) -{ +void CefRequestCToCpp::SetMethod(const CefString& method) { if (CEF_MEMBER_MISSING(struct_, set_method)) return; @@ -97,8 +92,7 @@ void CefRequestCToCpp::SetMethod(const CefString& method) method.GetStruct()); } -CefRefPtr CefRequestCToCpp::GetPostData() -{ +CefRefPtr CefRequestCToCpp::GetPostData() { if (CEF_MEMBER_MISSING(struct_, get_post_data)) return NULL; @@ -111,8 +105,7 @@ CefRefPtr CefRequestCToCpp::GetPostData() return CefPostDataCToCpp::Wrap(_retval); } -void CefRequestCToCpp::SetPostData(CefRefPtr postData) -{ +void CefRequestCToCpp::SetPostData(CefRefPtr postData) { if (CEF_MEMBER_MISSING(struct_, set_post_data)) return; @@ -128,8 +121,7 @@ void CefRequestCToCpp::SetPostData(CefRefPtr postData) CefPostDataCToCpp::Unwrap(postData)); } -void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) -{ +void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, get_header_map)) return; @@ -153,8 +145,7 @@ void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) } } -void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) -{ +void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, set_header_map)) return; @@ -176,8 +167,7 @@ void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) } void CefRequestCToCpp::Set(const CefString& url, const CefString& method, - CefRefPtr postData, const HeaderMap& headerMap) -{ + CefRefPtr postData, const HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, set)) return; @@ -211,8 +201,7 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method, cef_string_multimap_free(headerMapMultimap); } -CefRequest::RequestFlags CefRequestCToCpp::GetFlags() -{ +CefRequest::RequestFlags CefRequestCToCpp::GetFlags() { if (CEF_MEMBER_MISSING(struct_, get_flags)) return WUR_FLAG_NONE; @@ -225,8 +214,7 @@ CefRequest::RequestFlags CefRequestCToCpp::GetFlags() return _retval; } -void CefRequestCToCpp::SetFlags(RequestFlags flags) -{ +void CefRequestCToCpp::SetFlags(RequestFlags flags) { if (CEF_MEMBER_MISSING(struct_, set_flags)) return; @@ -237,8 +225,7 @@ void CefRequestCToCpp::SetFlags(RequestFlags flags) flags); } -CefString CefRequestCToCpp::GetFirstPartyForCookies() -{ +CefString CefRequestCToCpp::GetFirstPartyForCookies() { if (CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies)) return CefString(); @@ -253,8 +240,7 @@ CefString CefRequestCToCpp::GetFirstPartyForCookies() return _retvalStr; } -void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) -{ +void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { if (CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies)) return; diff --git a/libcef_dll/ctocpp/request_ctocpp.h b/libcef_dll/ctocpp/request_ctocpp.h index 0cf02eae1..77be93ba2 100644 --- a/libcef_dll/ctocpp/request_ctocpp.h +++ b/libcef_dll/ctocpp/request_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _REQUEST_CTOCPP_H -#define _REQUEST_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_request.h" #include "include/capi/cef_request_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefRequestCToCpp - : public CefCToCpp -{ -public: - CefRequestCToCpp(cef_request_t* str) + : public CefCToCpp { + public: + explicit CefRequestCToCpp(cef_request_t* str) : CefCToCpp(str) {} virtual ~CefRequestCToCpp() {} @@ -48,6 +48,6 @@ public: virtual void SetFirstPartyForCookies(const CefString& url) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _REQUEST_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.cc b/libcef_dll/ctocpp/request_handler_ctocpp.cc index b8b6e5c0b..79b035172 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -24,8 +24,7 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, NavType navType, - bool isRedirect) -{ + bool isRedirect) { if (CEF_MEMBER_MISSING(struct_, on_before_browse)) return false; @@ -59,8 +58,7 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( CefRefPtr browser, CefRefPtr request, CefString& redirectUrl, CefRefPtr& resourceStream, - CefRefPtr response, int loadFlags) -{ + CefRefPtr response, int loadFlags) { if (CEF_MEMBER_MISSING(struct_, on_before_resource_load)) return false; @@ -81,7 +79,7 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( // Translate param: resourceStream; type: refptr_diff_byref cef_stream_reader_t* resourceStreamStruct = NULL; - if(resourceStream.get()) + if (resourceStream.get()) resourceStreamStruct = CefStreamReaderCppToC::Wrap(resourceStream); cef_stream_reader_t* resourceStreamOrig = resourceStreamStruct; @@ -108,8 +106,7 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad( } void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, - const CefString& old_url, CefString& new_url) -{ + const CefString& old_url, CefString& new_url) { if (CEF_MEMBER_MISSING(struct_, on_resource_redirect)) return; @@ -133,8 +130,7 @@ void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, const CefString& url, CefRefPtr response, - CefRefPtr& filter) -{ + CefRefPtr& filter) { if (CEF_MEMBER_MISSING(struct_, on_resource_response)) return; @@ -155,7 +151,7 @@ void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, // Translate param: filter; type: refptr_same_byref cef_content_filter_t* filterStruct = NULL; - if(filter.get()) + if (filter.get()) filterStruct = CefContentFilterCToCpp::Unwrap(filter); cef_content_filter_t* filterOrig = filterStruct; @@ -177,8 +173,7 @@ void CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, } bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, - const CefString& url, bool& allowOSExecution) -{ + const CefString& url, bool& allowOSExecution) { if (CEF_MEMBER_MISSING(struct_, on_protocol_execution)) return false; @@ -211,8 +206,7 @@ bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, const CefString& mimeType, const CefString& fileName, int64 contentLength, - CefRefPtr& handler) -{ + CefRefPtr& handler) { if (CEF_MEMBER_MISSING(struct_, get_download_handler)) return false; @@ -233,7 +227,7 @@ bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, // Translate param: handler; type: refptr_same_byref cef_download_handler_t* handlerStruct = NULL; - if(handler.get()) + if (handler.get()) handlerStruct = CefDownloadHandlerCToCpp::Unwrap(handler); cef_download_handler_t* handlerOrig = handlerStruct; @@ -260,8 +254,7 @@ bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, bool isProxy, const CefString& host, int port, const CefString& realm, - const CefString& scheme, CefString& username, CefString& password) -{ + const CefString& scheme, CefString& username, CefString& password) { if (CEF_MEMBER_MISSING(struct_, get_auth_credentials)) return false; diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.h b/libcef_dll/ctocpp/request_handler_ctocpp.h index 973d82809..be820e4d5 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _REQUESTHANDLER_CTOCPP_H -#define _REQUESTHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_request_handler.h" #include "include/capi/cef_request_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefRequestHandlerCToCpp : public CefCToCpp -{ -public: - CefRequestHandlerCToCpp(cef_request_handler_t* str) + cef_request_handler_t> { + public: + explicit CefRequestHandlerCToCpp(cef_request_handler_t* str) : CefCToCpp(str) {} virtual ~CefRequestHandlerCToCpp() {} @@ -61,6 +61,6 @@ public: CefString& password) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _REQUESTHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/response_ctocpp.cc b/libcef_dll/ctocpp/response_ctocpp.cc index 165f5daa8..e5bfc0286 100644 --- a/libcef_dll/ctocpp/response_ctocpp.cc +++ b/libcef_dll/ctocpp/response_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -int CefResponseCToCpp::GetStatus() -{ +int CefResponseCToCpp::GetStatus() { if (CEF_MEMBER_MISSING(struct_, get_status)) return 0; @@ -30,8 +29,7 @@ int CefResponseCToCpp::GetStatus() return _retval; } -void CefResponseCToCpp::SetStatus(int status) -{ +void CefResponseCToCpp::SetStatus(int status) { if (CEF_MEMBER_MISSING(struct_, set_status)) return; @@ -42,8 +40,7 @@ void CefResponseCToCpp::SetStatus(int status) status); } -CefString CefResponseCToCpp::GetStatusText() -{ +CefString CefResponseCToCpp::GetStatusText() { if (CEF_MEMBER_MISSING(struct_, get_status_text)) return CefString(); @@ -58,8 +55,7 @@ CefString CefResponseCToCpp::GetStatusText() return _retvalStr; } -void CefResponseCToCpp::SetStatusText(const CefString& statusText) -{ +void CefResponseCToCpp::SetStatusText(const CefString& statusText) { if (CEF_MEMBER_MISSING(struct_, set_status_text)) return; @@ -75,8 +71,7 @@ void CefResponseCToCpp::SetStatusText(const CefString& statusText) statusText.GetStruct()); } -CefString CefResponseCToCpp::GetMimeType() -{ +CefString CefResponseCToCpp::GetMimeType() { if (CEF_MEMBER_MISSING(struct_, get_mime_type)) return CefString(); @@ -91,8 +86,7 @@ CefString CefResponseCToCpp::GetMimeType() return _retvalStr; } -void CefResponseCToCpp::SetMimeType(const CefString& mimeType) -{ +void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { if (CEF_MEMBER_MISSING(struct_, set_mime_type)) return; @@ -108,8 +102,7 @@ void CefResponseCToCpp::SetMimeType(const CefString& mimeType) mimeType.GetStruct()); } -CefString CefResponseCToCpp::GetHeader(const CefString& name) -{ +CefString CefResponseCToCpp::GetHeader(const CefString& name) { if (CEF_MEMBER_MISSING(struct_, get_header)) return CefString(); @@ -130,8 +123,7 @@ CefString CefResponseCToCpp::GetHeader(const CefString& name) return _retvalStr; } -void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) -{ +void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, get_header_map)) return; @@ -155,8 +147,7 @@ void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) } } -void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) -{ +void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { if (CEF_MEMBER_MISSING(struct_, set_header_map)) return; diff --git a/libcef_dll/ctocpp/response_ctocpp.h b/libcef_dll/ctocpp/response_ctocpp.h index 52ceeb440..8ec8a1fc2 100644 --- a/libcef_dll/ctocpp/response_ctocpp.h +++ b/libcef_dll/ctocpp/response_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _RESPONSE_CTOCPP_H -#define _RESPONSE_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_response.h" #include "include/capi/cef_response_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefResponseCToCpp - : public CefCToCpp -{ -public: - CefResponseCToCpp(cef_response_t* str) + : public CefCToCpp { + public: + explicit CefResponseCToCpp(cef_response_t* str) : CefCToCpp(str) {} virtual ~CefResponseCToCpp() {} @@ -43,6 +43,6 @@ public: virtual void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _RESPONSE_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc index 306cdd617..37773d592 100644 --- a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -void CefSchemeHandlerCallbackCToCpp::HeadersAvailable() -{ +void CefSchemeHandlerCallbackCToCpp::HeadersAvailable() { if (CEF_MEMBER_MISSING(struct_, headers_available)) return; @@ -26,8 +25,7 @@ void CefSchemeHandlerCallbackCToCpp::HeadersAvailable() struct_->headers_available(struct_); } -void CefSchemeHandlerCallbackCToCpp::BytesAvailable() -{ +void CefSchemeHandlerCallbackCToCpp::BytesAvailable() { if (CEF_MEMBER_MISSING(struct_, bytes_available)) return; @@ -37,8 +35,7 @@ void CefSchemeHandlerCallbackCToCpp::BytesAvailable() struct_->bytes_available(struct_); } -void CefSchemeHandlerCallbackCToCpp::Cancel() -{ +void CefSchemeHandlerCallbackCToCpp::Cancel() { if (CEF_MEMBER_MISSING(struct_, cancel)) return; diff --git a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h index fb513c755..5eb8db539 100644 --- a/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _SCHEMEHANDLERCALLBACK_CTOCPP_H -#define _SCHEMEHANDLERCALLBACK_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_CALLBACK_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" @@ -31,10 +32,9 @@ // This class may be instantiated and accessed wrapper-side only. class CefSchemeHandlerCallbackCToCpp : public CefCToCpp -{ -public: - CefSchemeHandlerCallbackCToCpp(cef_scheme_handler_callback_t* str) + cef_scheme_handler_callback_t> { + public: + explicit CefSchemeHandlerCallbackCToCpp(cef_scheme_handler_callback_t* str) : CefCToCpp(str) {} virtual ~CefSchemeHandlerCallbackCToCpp() {} @@ -45,6 +45,6 @@ public: virtual void Cancel() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _SCHEMEHANDLERCALLBACK_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_CALLBACK_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/scheme_handler_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_ctocpp.cc index 2f6a82ead..e187a38e4 100644 --- a/libcef_dll/ctocpp/scheme_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefSchemeHandlerCToCpp::ProcessRequest(CefRefPtr request, - CefRefPtr callback) -{ + CefRefPtr callback) { if (CEF_MEMBER_MISSING(struct_, process_request)) return false; @@ -45,8 +44,7 @@ bool CefSchemeHandlerCToCpp::ProcessRequest(CefRefPtr request, } void CefSchemeHandlerCToCpp::GetResponseHeaders(CefRefPtr response, - int64& response_length, CefString& redirectUrl) -{ + int64& response_length, CefString& redirectUrl) { if (CEF_MEMBER_MISSING(struct_, get_response_headers)) return; @@ -65,8 +63,7 @@ void CefSchemeHandlerCToCpp::GetResponseHeaders(CefRefPtr response, } bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, - int& bytes_read, CefRefPtr callback) -{ + int& bytes_read, CefRefPtr callback) { if (CEF_MEMBER_MISSING(struct_, read_response)) return false; @@ -92,8 +89,7 @@ bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, return _retval?true:false; } -void CefSchemeHandlerCToCpp::Cancel() -{ +void CefSchemeHandlerCToCpp::Cancel() { if (CEF_MEMBER_MISSING(struct_, cancel)) return; diff --git a/libcef_dll/ctocpp/scheme_handler_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_ctocpp.h index e845f37c0..e4a78a45f 100644 --- a/libcef_dll/ctocpp/scheme_handler_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _SCHEMEHANDLER_CTOCPP_H -#define _SCHEMEHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" @@ -31,10 +32,9 @@ // This class may be instantiated and accessed DLL-side only. class CefSchemeHandlerCToCpp : public CefCToCpp -{ -public: - CefSchemeHandlerCToCpp(cef_scheme_handler_t* str) + cef_scheme_handler_t> { + public: + explicit CefSchemeHandlerCToCpp(cef_scheme_handler_t* str) : CefCToCpp(str) {} virtual ~CefSchemeHandlerCToCpp() {} @@ -49,6 +49,6 @@ public: virtual void Cancel() OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _SCHEMEHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc index 3e7018fa6..3c1aac234 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -20,8 +20,7 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( CefRefPtr browser, const CefString& scheme_name, - CefRefPtr request) -{ + CefRefPtr request) { if (CEF_MEMBER_MISSING(struct_, create)) return NULL; diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h index a8823767a..90cfd7f72 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _SCHEMEHANDLERFACTORY_CTOCPP_H -#define _SCHEMEHANDLERFACTORY_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_scheme.h" #include "include/capi/cef_scheme_capi.h" @@ -31,10 +32,9 @@ // This class may be instantiated and accessed DLL-side only. class CefSchemeHandlerFactoryCToCpp : public CefCToCpp -{ -public: - CefSchemeHandlerFactoryCToCpp(cef_scheme_handler_factory_t* str) + cef_scheme_handler_factory_t> { + public: + explicit CefSchemeHandlerFactoryCToCpp(cef_scheme_handler_factory_t* str) : CefCToCpp(str) {} virtual ~CefSchemeHandlerFactoryCToCpp() {} @@ -44,6 +44,6 @@ public: const CefString& scheme_name, CefRefPtr request) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _SCHEMEHANDLERFACTORY_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/storage_visitor_ctocpp.cc b/libcef_dll/ctocpp/storage_visitor_ctocpp.cc index 1995250af..414f5b82f 100644 --- a/libcef_dll/ctocpp/storage_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/storage_visitor_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ bool CefStorageVisitorCToCpp::Visit(CefStorageType type, const CefString& origin, const CefString& key, const CefString& value, - int count, int total, bool& deleteData) -{ + int count, int total, bool& deleteData) { if (CEF_MEMBER_MISSING(struct_, visit)) return false; diff --git a/libcef_dll/ctocpp/storage_visitor_ctocpp.h b/libcef_dll/ctocpp/storage_visitor_ctocpp.h index 3e9a33ce3..5ce43d827 100644 --- a/libcef_dll/ctocpp/storage_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/storage_visitor_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _STORAGEVISITOR_CTOCPP_H -#define _STORAGEVISITOR_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_STORAGE_VISITOR_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_STORAGE_VISITOR_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_storage.h" #include "include/capi/cef_storage_capi.h" @@ -25,10 +26,9 @@ // This class may be instantiated and accessed DLL-side only. class CefStorageVisitorCToCpp : public CefCToCpp -{ -public: - CefStorageVisitorCToCpp(cef_storage_visitor_t* str) + cef_storage_visitor_t> { + public: + explicit CefStorageVisitorCToCpp(cef_storage_visitor_t* str) : CefCToCpp(str) {} virtual ~CefStorageVisitorCToCpp() {} @@ -39,6 +39,6 @@ public: bool& deleteData) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _STORAGEVISITOR_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_STORAGE_VISITOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/libcef_dll/ctocpp/stream_reader_ctocpp.cc index 8c38c5eee..239d5c215 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // STATIC METHODS - Body may be edited by hand. CefRefPtr CefStreamReader::CreateForFile( - const CefString& fileName) -{ + const CefString& fileName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: fileName; type: string_byref_const @@ -35,8 +34,7 @@ CefRefPtr CefStreamReader::CreateForFile( } CefRefPtr CefStreamReader::CreateForData(void* data, - size_t size) -{ + size_t size) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: data; type: simple_byaddr @@ -54,8 +52,7 @@ CefRefPtr CefStreamReader::CreateForData(void* data, } CefRefPtr CefStreamReader::CreateForHandler( - CefRefPtr handler) -{ + CefRefPtr handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: handler; type: refptr_diff @@ -74,8 +71,7 @@ CefRefPtr CefStreamReader::CreateForHandler( // VIRTUAL METHODS - Body may be edited by hand. -size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) -{ +size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { if (CEF_MEMBER_MISSING(struct_, read)) return 0; @@ -96,8 +92,7 @@ size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) return _retval; } -int CefStreamReaderCToCpp::Seek(long offset, int whence) -{ +int CefStreamReaderCToCpp::Seek(int64 offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) return 0; @@ -112,22 +107,20 @@ int CefStreamReaderCToCpp::Seek(long offset, int whence) return _retval; } -long CefStreamReaderCToCpp::Tell() -{ +int64 CefStreamReaderCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long _retval = struct_->tell(struct_); + int64 _retval = struct_->tell(struct_); // Return type: simple return _retval; } -int CefStreamReaderCToCpp::Eof() -{ +int CefStreamReaderCToCpp::Eof() { if (CEF_MEMBER_MISSING(struct_, eof)) return 0; diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.h b/libcef_dll/ctocpp/stream_reader_ctocpp.h index 653353c81..a153b2642 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.h +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _STREAMREADER_CTOCPP_H -#define _STREAMREADER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -25,21 +26,20 @@ // This class may be instantiated and accessed wrapper-side only. class CefStreamReaderCToCpp : public CefCToCpp -{ -public: - CefStreamReaderCToCpp(cef_stream_reader_t* str) + cef_stream_reader_t> { + public: + explicit CefStreamReaderCToCpp(cef_stream_reader_t* str) : CefCToCpp( str) {} virtual ~CefStreamReaderCToCpp() {} // CefStreamReader methods virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Eof() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _STREAMREADER_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/libcef_dll/ctocpp/stream_writer_ctocpp.cc index 70306d44a..a520d99a3 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // STATIC METHODS - Body may be edited by hand. CefRefPtr CefStreamWriter::CreateForFile( - const CefString& fileName) -{ + const CefString& fileName) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: fileName; type: string_byref_const @@ -35,8 +34,7 @@ CefRefPtr CefStreamWriter::CreateForFile( } CefRefPtr CefStreamWriter::CreateForHandler( - CefRefPtr handler) -{ + CefRefPtr handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: handler; type: refptr_diff @@ -55,8 +53,7 @@ CefRefPtr CefStreamWriter::CreateForHandler( // VIRTUAL METHODS - Body may be edited by hand. -size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) -{ +size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { if (CEF_MEMBER_MISSING(struct_, write)) return 0; @@ -77,8 +74,7 @@ size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) return _retval; } -int CefStreamWriterCToCpp::Seek(long offset, int whence) -{ +int CefStreamWriterCToCpp::Seek(int64 offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) return 0; @@ -93,22 +89,20 @@ int CefStreamWriterCToCpp::Seek(long offset, int whence) return _retval; } -long CefStreamWriterCToCpp::Tell() -{ +int64 CefStreamWriterCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long _retval = struct_->tell(struct_); + int64 _retval = struct_->tell(struct_); // Return type: simple return _retval; } -int CefStreamWriterCToCpp::Flush() -{ +int CefStreamWriterCToCpp::Flush() { if (CEF_MEMBER_MISSING(struct_, flush)) return 0; diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.h b/libcef_dll/ctocpp/stream_writer_ctocpp.h index ad3351d29..a764b01ad 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.h +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _STREAMWRITER_CTOCPP_H -#define _STREAMWRITER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -25,21 +26,20 @@ // This class may be instantiated and accessed wrapper-side only. class CefStreamWriterCToCpp : public CefCToCpp -{ -public: - CefStreamWriterCToCpp(cef_stream_writer_t* str) + cef_stream_writer_t> { + public: + explicit CefStreamWriterCToCpp(cef_stream_writer_t* str) : CefCToCpp( str) {} virtual ~CefStreamWriterCToCpp() {} // CefStreamWriter methods virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Flush() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _STREAMWRITER_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/task_ctocpp.cc b/libcef_dll/ctocpp/task_ctocpp.cc index 9904d4821..0a2e48a89 100644 --- a/libcef_dll/ctocpp/task_ctocpp.cc +++ b/libcef_dll/ctocpp/task_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -void CefTaskCToCpp::Execute(CefThreadId threadId) -{ +void CefTaskCToCpp::Execute(CefThreadId threadId) { if (CEF_MEMBER_MISSING(struct_, execute)) return; diff --git a/libcef_dll/ctocpp/task_ctocpp.h b/libcef_dll/ctocpp/task_ctocpp.h index d26524b1d..58dce8a2a 100644 --- a/libcef_dll/ctocpp/task_ctocpp.h +++ b/libcef_dll/ctocpp/task_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _TASK_CTOCPP_H -#define _TASK_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_task.h" #include "include/capi/cef_task_capi.h" @@ -24,10 +25,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefTaskCToCpp - : public CefCToCpp -{ -public: - CefTaskCToCpp(cef_task_t* str) + : public CefCToCpp { + public: + explicit CefTaskCToCpp(cef_task_t* str) : CefCToCpp(str) {} virtual ~CefTaskCToCpp() {} @@ -35,6 +35,6 @@ public: virtual void Execute(CefThreadId threadId) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _TASK_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/libcef_dll/ctocpp/v8accessor_ctocpp.cc index 3cca7be9d..f3b9b6e56 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.cc +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, - CefString& exception) -{ + CefString& exception) { if (CEF_MEMBER_MISSING(struct_, get)) return false; @@ -36,7 +35,7 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, // Translate param: retval; type: refptr_diff_byref cef_v8value_t* retvalStruct = NULL; - if(retval.get()) + if (retval.get()) retvalStruct = CefV8ValueCppToC::Wrap(retval); cef_v8value_t* retvalOrig = retvalStruct; @@ -62,8 +61,7 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, bool CefV8AccessorCToCpp::Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, - CefString& exception) -{ + CefString& exception) { if (CEF_MEMBER_MISSING(struct_, set)) return false; diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.h b/libcef_dll/ctocpp/v8accessor_ctocpp.h index c49bfbd7e..31ba313cc 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.h +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8ACCESSOR_CTOCPP_H -#define _V8ACCESSOR_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,10 +29,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefV8AccessorCToCpp - : public CefCToCpp -{ -public: - CefV8AccessorCToCpp(cef_v8accessor_t* str) + : public CefCToCpp { + public: + explicit CefV8AccessorCToCpp(cef_v8accessor_t* str) : CefCToCpp(str) {} virtual ~CefV8AccessorCToCpp() {} @@ -42,6 +42,6 @@ public: const CefRefPtr value, CefString& exception) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _V8ACCESSOR_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8context_ctocpp.cc b/libcef_dll/ctocpp/v8context_ctocpp.cc index 5ef2ca19d..ec2eca20b 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefV8Context::GetCurrentContext() -{ +CefRefPtr CefV8Context::GetCurrentContext() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -29,8 +28,7 @@ CefRefPtr CefV8Context::GetCurrentContext() return CefV8ContextCToCpp::Wrap(_retval); } -CefRefPtr CefV8Context::GetEnteredContext() -{ +CefRefPtr CefV8Context::GetEnteredContext() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -40,8 +38,7 @@ CefRefPtr CefV8Context::GetEnteredContext() return CefV8ContextCToCpp::Wrap(_retval); } -bool CefV8Context::InContext() -{ +bool CefV8Context::InContext() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -54,8 +51,7 @@ bool CefV8Context::InContext() // VIRTUAL METHODS - Body may be edited by hand. -CefRefPtr CefV8ContextCToCpp::GetBrowser() -{ +CefRefPtr CefV8ContextCToCpp::GetBrowser() { if (CEF_MEMBER_MISSING(struct_, get_browser)) return NULL; @@ -68,8 +64,7 @@ CefRefPtr CefV8ContextCToCpp::GetBrowser() return CefBrowserCToCpp::Wrap(_retval); } -CefRefPtr CefV8ContextCToCpp::GetFrame() -{ +CefRefPtr CefV8ContextCToCpp::GetFrame() { if (CEF_MEMBER_MISSING(struct_, get_frame)) return NULL; @@ -82,8 +77,7 @@ CefRefPtr CefV8ContextCToCpp::GetFrame() return CefFrameCToCpp::Wrap(_retval); } -CefRefPtr CefV8ContextCToCpp::GetGlobal() -{ +CefRefPtr CefV8ContextCToCpp::GetGlobal() { if (CEF_MEMBER_MISSING(struct_, get_global)) return NULL; @@ -96,8 +90,7 @@ CefRefPtr CefV8ContextCToCpp::GetGlobal() return CefV8ValueCToCpp::Wrap(_retval); } -bool CefV8ContextCToCpp::Enter() -{ +bool CefV8ContextCToCpp::Enter() { if (CEF_MEMBER_MISSING(struct_, enter)) return false; @@ -110,8 +103,7 @@ bool CefV8ContextCToCpp::Enter() return _retval?true:false; } -bool CefV8ContextCToCpp::Exit() -{ +bool CefV8ContextCToCpp::Exit() { if (CEF_MEMBER_MISSING(struct_, exit)) return false; @@ -124,8 +116,7 @@ bool CefV8ContextCToCpp::Exit() return _retval?true:false; } -bool CefV8ContextCToCpp::IsSame(CefRefPtr that) -{ +bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) return false; diff --git a/libcef_dll/ctocpp/v8context_ctocpp.h b/libcef_dll/ctocpp/v8context_ctocpp.h index 88a065a14..c2e0f1c9a 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8CONTEXT_CTOCPP_H -#define _V8CONTEXT_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,10 +29,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefV8ContextCToCpp - : public CefCToCpp -{ -public: - CefV8ContextCToCpp(cef_v8context_t* str) + : public CefCToCpp { + public: + explicit CefV8ContextCToCpp(cef_v8context_t* str) : CefCToCpp(str) {} virtual ~CefV8ContextCToCpp() {} @@ -44,6 +44,6 @@ public: virtual bool IsSame(CefRefPtr that) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _V8CONTEXT_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8context_handler_ctocpp.cc b/libcef_dll/ctocpp/v8context_handler_ctocpp.cc index 0d2b17d64..7c9f8be92 100644 --- a/libcef_dll/ctocpp/v8context_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefV8ContextHandlerCToCpp::OnContextCreated(CefRefPtr browser, - CefRefPtr frame, CefRefPtr context) -{ + CefRefPtr frame, CefRefPtr context) { if (CEF_MEMBER_MISSING(struct_, on_context_created)) return; @@ -47,8 +46,7 @@ void CefV8ContextHandlerCToCpp::OnContextCreated(CefRefPtr browser, } void CefV8ContextHandlerCToCpp::OnContextReleased(CefRefPtr browser, - CefRefPtr frame, CefRefPtr context) -{ + CefRefPtr frame, CefRefPtr context) { if (CEF_MEMBER_MISSING(struct_, on_context_released)) return; diff --git a/libcef_dll/ctocpp/v8context_handler_ctocpp.h b/libcef_dll/ctocpp/v8context_handler_ctocpp.h index ff304f285..18a494e02 100644 --- a/libcef_dll/ctocpp/v8context_handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8CONTEXTHANDLER_CTOCPP_H -#define _V8CONTEXTHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_v8context_handler.h" #include "include/capi/cef_v8context_handler_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefV8ContextHandlerCToCpp : public CefCToCpp -{ -public: - CefV8ContextHandlerCToCpp(cef_v8context_handler_t* str) + cef_v8context_handler_t> { + public: + explicit CefV8ContextHandlerCToCpp(cef_v8context_handler_t* str) : CefCToCpp(str) {} virtual ~CefV8ContextHandlerCToCpp() {} @@ -44,6 +44,6 @@ public: CefRefPtr frame, CefRefPtr context) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _V8CONTEXTHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.cc b/libcef_dll/ctocpp/v8exception_ctocpp.cc index 9834e64d7..277f24f01 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.cc +++ b/libcef_dll/ctocpp/v8exception_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -CefString CefV8ExceptionCToCpp::GetMessage() -{ +CefString CefV8ExceptionCToCpp::GetMessage() { if (CEF_MEMBER_MISSING(struct_, get_message)) return CefString(); @@ -31,8 +30,7 @@ CefString CefV8ExceptionCToCpp::GetMessage() return _retvalStr; } -CefString CefV8ExceptionCToCpp::GetSourceLine() -{ +CefString CefV8ExceptionCToCpp::GetSourceLine() { if (CEF_MEMBER_MISSING(struct_, get_source_line)) return CefString(); @@ -47,8 +45,7 @@ CefString CefV8ExceptionCToCpp::GetSourceLine() return _retvalStr; } -CefString CefV8ExceptionCToCpp::GetScriptResourceName() -{ +CefString CefV8ExceptionCToCpp::GetScriptResourceName() { if (CEF_MEMBER_MISSING(struct_, get_script_resource_name)) return CefString(); @@ -63,8 +60,7 @@ CefString CefV8ExceptionCToCpp::GetScriptResourceName() return _retvalStr; } -int CefV8ExceptionCToCpp::GetLineNumber() -{ +int CefV8ExceptionCToCpp::GetLineNumber() { if (CEF_MEMBER_MISSING(struct_, get_line_number)) return 0; @@ -77,8 +73,7 @@ int CefV8ExceptionCToCpp::GetLineNumber() return _retval; } -int CefV8ExceptionCToCpp::GetStartPosition() -{ +int CefV8ExceptionCToCpp::GetStartPosition() { if (CEF_MEMBER_MISSING(struct_, get_start_position)) return 0; @@ -91,8 +86,7 @@ int CefV8ExceptionCToCpp::GetStartPosition() return _retval; } -int CefV8ExceptionCToCpp::GetEndPosition() -{ +int CefV8ExceptionCToCpp::GetEndPosition() { if (CEF_MEMBER_MISSING(struct_, get_end_position)) return 0; @@ -105,8 +99,7 @@ int CefV8ExceptionCToCpp::GetEndPosition() return _retval; } -int CefV8ExceptionCToCpp::GetStartColumn() -{ +int CefV8ExceptionCToCpp::GetStartColumn() { if (CEF_MEMBER_MISSING(struct_, get_start_column)) return 0; @@ -119,8 +112,7 @@ int CefV8ExceptionCToCpp::GetStartColumn() return _retval; } -int CefV8ExceptionCToCpp::GetEndColumn() -{ +int CefV8ExceptionCToCpp::GetEndColumn() { if (CEF_MEMBER_MISSING(struct_, get_end_column)) return 0; diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.h b/libcef_dll/ctocpp/v8exception_ctocpp.h index 12bda8822..e972c7270 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.h +++ b/libcef_dll/ctocpp/v8exception_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8EXCEPTION_CTOCPP_H -#define _V8EXCEPTION_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,10 +29,10 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefV8ExceptionCToCpp - : public CefCToCpp -{ -public: - CefV8ExceptionCToCpp(cef_v8exception_t* str) + : public CefCToCpp { + public: + explicit CefV8ExceptionCToCpp(cef_v8exception_t* str) : CefCToCpp( str) {} virtual ~CefV8ExceptionCToCpp() {} @@ -47,6 +48,6 @@ public: virtual int GetEndColumn() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _V8EXCEPTION_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.cc b/libcef_dll/ctocpp/v8handler_ctocpp.cc index c4e342c22..eb4ecdaf2 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, - CefRefPtr& retval, CefString& exception) -{ + CefRefPtr& retval, CefString& exception) { if (CEF_MEMBER_MISSING(struct_, execute)) return false; @@ -48,7 +47,7 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, } // Translate param: retval; type: refptr_diff_byref cef_v8value_t* retvalStruct = NULL; - if(retval.get()) + if (retval.get()) retvalStruct = CefV8ValueCppToC::Wrap(retval); cef_v8value_t* retvalOrig = retvalStruct; diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.h b/libcef_dll/ctocpp/v8handler_ctocpp.h index 27412d8c4..6cf3c8f73 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _V8HANDLER_CTOCPP_H -#define _V8HANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" @@ -28,10 +29,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed DLL-side only. class CefV8HandlerCToCpp - : public CefCToCpp -{ -public: - CefV8HandlerCToCpp(cef_v8handler_t* str) + : public CefCToCpp { + public: + explicit CefV8HandlerCToCpp(cef_v8handler_t* str) : CefCToCpp(str) {} virtual ~CefV8HandlerCToCpp() {} @@ -41,6 +41,6 @@ public: CefString& exception) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _V8HANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/v8value_ctocpp.cc b/libcef_dll/ctocpp/v8value_ctocpp.cc index e0d5954b4..22fd4a8a1 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.cc +++ b/libcef_dll/ctocpp/v8value_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -21,8 +21,7 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefV8Value::CreateUndefined() -{ +CefRefPtr CefV8Value::CreateUndefined() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -32,8 +31,7 @@ CefRefPtr CefV8Value::CreateUndefined() return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateNull() -{ +CefRefPtr CefV8Value::CreateNull() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -43,8 +41,7 @@ CefRefPtr CefV8Value::CreateNull() return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateBool(bool value) -{ +CefRefPtr CefV8Value::CreateBool(bool value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -55,8 +52,7 @@ CefRefPtr CefV8Value::CreateBool(bool value) return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateInt(int value) -{ +CefRefPtr CefV8Value::CreateInt(int value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -67,8 +63,7 @@ CefRefPtr CefV8Value::CreateInt(int value) return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateDouble(double value) -{ +CefRefPtr CefV8Value::CreateDouble(double value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -79,8 +74,7 @@ CefRefPtr CefV8Value::CreateDouble(double value) return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateDate(const CefTime& date) -{ +CefRefPtr CefV8Value::CreateDate(const CefTime& date) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -91,8 +85,7 @@ CefRefPtr CefV8Value::CreateDate(const CefTime& date) return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateString(const CefString& value) -{ +CefRefPtr CefV8Value::CreateString(const CefString& value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: value @@ -106,8 +99,7 @@ CefRefPtr CefV8Value::CreateString(const CefString& value) } CefRefPtr CefV8Value::CreateObject(CefRefPtr user_data, - CefRefPtr accessor) -{ + CefRefPtr accessor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: user_data, accessor @@ -121,8 +113,7 @@ CefRefPtr CefV8Value::CreateObject(CefRefPtr user_data, return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8Value::CreateArray() -{ +CefRefPtr CefV8Value::CreateArray() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -133,8 +124,7 @@ CefRefPtr CefV8Value::CreateArray() } CefRefPtr CefV8Value::CreateFunction(const CefString& name, - CefRefPtr handler) -{ + CefRefPtr handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: name; type: string_byref_const @@ -158,8 +148,7 @@ CefRefPtr CefV8Value::CreateFunction(const CefString& name, // VIRTUAL METHODS - Body may be edited by hand. -bool CefV8ValueCToCpp::IsUndefined() -{ +bool CefV8ValueCToCpp::IsUndefined() { if (CEF_MEMBER_MISSING(struct_, is_undefined)) return false; @@ -172,8 +161,7 @@ bool CefV8ValueCToCpp::IsUndefined() return _retval?true:false; } -bool CefV8ValueCToCpp::IsNull() -{ +bool CefV8ValueCToCpp::IsNull() { if (CEF_MEMBER_MISSING(struct_, is_null)) return false; @@ -186,8 +174,7 @@ bool CefV8ValueCToCpp::IsNull() return _retval?true:false; } -bool CefV8ValueCToCpp::IsBool() -{ +bool CefV8ValueCToCpp::IsBool() { if (CEF_MEMBER_MISSING(struct_, is_bool)) return false; @@ -200,8 +187,7 @@ bool CefV8ValueCToCpp::IsBool() return _retval?true:false; } -bool CefV8ValueCToCpp::IsInt() -{ +bool CefV8ValueCToCpp::IsInt() { if (CEF_MEMBER_MISSING(struct_, is_int)) return false; @@ -214,8 +200,7 @@ bool CefV8ValueCToCpp::IsInt() return _retval?true:false; } -bool CefV8ValueCToCpp::IsDouble() -{ +bool CefV8ValueCToCpp::IsDouble() { if (CEF_MEMBER_MISSING(struct_, is_double)) return false; @@ -228,8 +213,7 @@ bool CefV8ValueCToCpp::IsDouble() return _retval?true:false; } -bool CefV8ValueCToCpp::IsDate() -{ +bool CefV8ValueCToCpp::IsDate() { if (CEF_MEMBER_MISSING(struct_, is_date)) return false; @@ -242,8 +226,7 @@ bool CefV8ValueCToCpp::IsDate() return _retval?true:false; } -bool CefV8ValueCToCpp::IsString() -{ +bool CefV8ValueCToCpp::IsString() { if (CEF_MEMBER_MISSING(struct_, is_string)) return false; @@ -256,8 +239,7 @@ bool CefV8ValueCToCpp::IsString() return _retval?true:false; } -bool CefV8ValueCToCpp::IsObject() -{ +bool CefV8ValueCToCpp::IsObject() { if (CEF_MEMBER_MISSING(struct_, is_object)) return false; @@ -270,8 +252,7 @@ bool CefV8ValueCToCpp::IsObject() return _retval?true:false; } -bool CefV8ValueCToCpp::IsArray() -{ +bool CefV8ValueCToCpp::IsArray() { if (CEF_MEMBER_MISSING(struct_, is_array)) return false; @@ -284,8 +265,7 @@ bool CefV8ValueCToCpp::IsArray() return _retval?true:false; } -bool CefV8ValueCToCpp::IsFunction() -{ +bool CefV8ValueCToCpp::IsFunction() { if (CEF_MEMBER_MISSING(struct_, is_function)) return false; @@ -298,8 +278,7 @@ bool CefV8ValueCToCpp::IsFunction() return _retval?true:false; } -bool CefV8ValueCToCpp::IsSame(CefRefPtr that) -{ +bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { if (CEF_MEMBER_MISSING(struct_, is_same)) return false; @@ -318,8 +297,7 @@ bool CefV8ValueCToCpp::IsSame(CefRefPtr that) return _retval?true:false; } -bool CefV8ValueCToCpp::GetBoolValue() -{ +bool CefV8ValueCToCpp::GetBoolValue() { if (CEF_MEMBER_MISSING(struct_, get_bool_value)) return false; @@ -332,8 +310,7 @@ bool CefV8ValueCToCpp::GetBoolValue() return _retval?true:false; } -int CefV8ValueCToCpp::GetIntValue() -{ +int CefV8ValueCToCpp::GetIntValue() { if (CEF_MEMBER_MISSING(struct_, get_int_value)) return 0; @@ -346,8 +323,7 @@ int CefV8ValueCToCpp::GetIntValue() return _retval; } -double CefV8ValueCToCpp::GetDoubleValue() -{ +double CefV8ValueCToCpp::GetDoubleValue() { if (CEF_MEMBER_MISSING(struct_, get_double_value)) return 0; @@ -360,8 +336,7 @@ double CefV8ValueCToCpp::GetDoubleValue() return _retval; } -CefTime CefV8ValueCToCpp::GetDateValue() -{ +CefTime CefV8ValueCToCpp::GetDateValue() { if (CEF_MEMBER_MISSING(struct_, get_date_value)) return CefTime(); @@ -374,8 +349,7 @@ CefTime CefV8ValueCToCpp::GetDateValue() return _retval; } -CefString CefV8ValueCToCpp::GetStringValue() -{ +CefString CefV8ValueCToCpp::GetStringValue() { if (CEF_MEMBER_MISSING(struct_, get_string_value)) return CefString(); @@ -390,8 +364,7 @@ CefString CefV8ValueCToCpp::GetStringValue() return _retvalStr; } -bool CefV8ValueCToCpp::HasValue(const CefString& key) -{ +bool CefV8ValueCToCpp::HasValue(const CefString& key) { if (CEF_MEMBER_MISSING(struct_, has_value_bykey)) return false; @@ -410,15 +383,14 @@ bool CefV8ValueCToCpp::HasValue(const CefString& key) return _retval?true:false; } -bool CefV8ValueCToCpp::HasValue(int index) -{ +bool CefV8ValueCToCpp::HasValue(int index) { if (CEF_MEMBER_MISSING(struct_, has_value_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return false; @@ -430,8 +402,7 @@ bool CefV8ValueCToCpp::HasValue(int index) return _retval?true:false; } -bool CefV8ValueCToCpp::DeleteValue(const CefString& key) -{ +bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { if (CEF_MEMBER_MISSING(struct_, delete_value_bykey)) return false; @@ -450,15 +421,14 @@ bool CefV8ValueCToCpp::DeleteValue(const CefString& key) return _retval?true:false; } -bool CefV8ValueCToCpp::DeleteValue(int index) -{ +bool CefV8ValueCToCpp::DeleteValue(int index) { if (CEF_MEMBER_MISSING(struct_, delete_value_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return false; @@ -470,8 +440,7 @@ bool CefV8ValueCToCpp::DeleteValue(int index) return _retval?true:false; } -CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) -{ +CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { if (CEF_MEMBER_MISSING(struct_, get_value_bykey)) return NULL; @@ -490,15 +459,14 @@ CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) return CefV8ValueCToCpp::Wrap(_retval); } -CefRefPtr CefV8ValueCToCpp::GetValue(int index) -{ +CefRefPtr CefV8ValueCToCpp::GetValue(int index) { if (CEF_MEMBER_MISSING(struct_, get_value_byindex)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return NULL; @@ -511,8 +479,7 @@ CefRefPtr CefV8ValueCToCpp::GetValue(int index) } bool CefV8ValueCToCpp::SetValue(const CefString& key, - CefRefPtr value, PropertyAttribute attribute) -{ + CefRefPtr value, PropertyAttribute attribute) { if (CEF_MEMBER_MISSING(struct_, set_value_bykey)) return false; @@ -537,15 +504,14 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, return _retval?true:false; } -bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) -{ +bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { if (CEF_MEMBER_MISSING(struct_, set_value_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return false; // Verify param: value; type: refptr_same @@ -563,8 +529,7 @@ bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) } bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, - PropertyAttribute attribute) -{ + PropertyAttribute attribute) { if (CEF_MEMBER_MISSING(struct_, set_value_byaccessor)) return false; @@ -585,8 +550,7 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, return _retval?true:false; } -bool CefV8ValueCToCpp::GetKeys(std::vector& keys) -{ +bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { if (CEF_MEMBER_MISSING(struct_, get_keys)) return false; @@ -613,8 +577,7 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) return _retval?true:false; } -CefRefPtr CefV8ValueCToCpp::GetUserData() -{ +CefRefPtr CefV8ValueCToCpp::GetUserData() { if (CEF_MEMBER_MISSING(struct_, get_user_data)) return NULL; @@ -627,8 +590,7 @@ CefRefPtr CefV8ValueCToCpp::GetUserData() return CefBaseCppToC::Unwrap(_retval); } -int CefV8ValueCToCpp::GetArrayLength() -{ +int CefV8ValueCToCpp::GetArrayLength() { if (CEF_MEMBER_MISSING(struct_, get_array_length)) return 0; @@ -641,8 +603,7 @@ int CefV8ValueCToCpp::GetArrayLength() return _retval; } -CefString CefV8ValueCToCpp::GetFunctionName() -{ +CefString CefV8ValueCToCpp::GetFunctionName() { if (CEF_MEMBER_MISSING(struct_, get_function_name)) return CefString(); @@ -657,8 +618,7 @@ CefString CefV8ValueCToCpp::GetFunctionName() return _retvalStr; } -CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() -{ +CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { if (CEF_MEMBER_MISSING(struct_, get_function_handler)) return NULL; @@ -673,8 +633,7 @@ CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefRefPtr& exception, bool rethrow_exception) -{ + CefRefPtr& exception, bool rethrow_exception) { if (CEF_MEMBER_MISSING(struct_, execute_function)) return false; @@ -696,12 +655,12 @@ bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr object, } // Translate param: retval; type: refptr_same_byref cef_v8value_t* retvalStruct = NULL; - if(retval.get()) + if (retval.get()) retvalStruct = CefV8ValueCToCpp::Unwrap(retval); cef_v8value_t* retvalOrig = retvalStruct; // Translate param: exception; type: refptr_same_byref cef_v8exception_t* exceptionStruct = NULL; - if(exception.get()) + if (exception.get()) exceptionStruct = CefV8ExceptionCToCpp::Unwrap(exception); cef_v8exception_t* exceptionOrig = exceptionStruct; @@ -738,8 +697,7 @@ bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr object, bool CefV8ValueCToCpp::ExecuteFunctionWithContext( CefRefPtr context, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefRefPtr& exception, bool rethrow_exception) -{ + CefRefPtr& exception, bool rethrow_exception) { if (CEF_MEMBER_MISSING(struct_, execute_function_with_context)) return false; @@ -765,12 +723,12 @@ bool CefV8ValueCToCpp::ExecuteFunctionWithContext( } // Translate param: retval; type: refptr_same_byref cef_v8value_t* retvalStruct = NULL; - if(retval.get()) + if (retval.get()) retvalStruct = CefV8ValueCToCpp::Unwrap(retval); cef_v8value_t* retvalOrig = retvalStruct; // Translate param: exception; type: refptr_same_byref cef_v8exception_t* exceptionStruct = NULL; - if(exception.get()) + if (exception.get()) exceptionStruct = CefV8ExceptionCToCpp::Unwrap(exception); cef_v8exception_t* exceptionOrig = exceptionStruct; diff --git a/libcef_dll/ctocpp/v8value_ctocpp.h b/libcef_dll/ctocpp/v8value_ctocpp.h index 037db32d1..229878995 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.h +++ b/libcef_dll/ctocpp/v8value_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,13 +10,15 @@ // for more information. // -#ifndef _V8VALUE_CTOCPP_H -#define _V8VALUE_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED +#include #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" #include "include/cef_browser.h" @@ -28,10 +30,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefV8ValueCToCpp - : public CefCToCpp -{ -public: - CefV8ValueCToCpp(cef_v8value_t* str) + : public CefCToCpp { + public: + explicit CefV8ValueCToCpp(cef_v8value_t* str) : CefCToCpp(str) {} virtual ~CefV8ValueCToCpp() {} @@ -77,6 +78,6 @@ public: bool rethrow_exception) OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _V8VALUE_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc index b158bf51c..bcddbcbbf 100644 --- a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc +++ b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -19,8 +19,7 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefWebURLRequestClientCToCpp::OnStateChange( - CefRefPtr requester, RequestState state) -{ + CefRefPtr requester, RequestState state) { if (CEF_MEMBER_MISSING(struct_, on_state_change)) return; @@ -39,8 +38,7 @@ void CefWebURLRequestClientCToCpp::OnStateChange( void CefWebURLRequestClientCToCpp::OnRedirect( CefRefPtr requester, CefRefPtr request, - CefRefPtr response) -{ + CefRefPtr response) { if (CEF_MEMBER_MISSING(struct_, on_redirect)) return; @@ -67,8 +65,7 @@ void CefWebURLRequestClientCToCpp::OnRedirect( } void CefWebURLRequestClientCToCpp::OnHeadersReceived( - CefRefPtr requester, CefRefPtr response) -{ + CefRefPtr requester, CefRefPtr response) { if (CEF_MEMBER_MISSING(struct_, on_headers_received)) return; @@ -91,8 +88,7 @@ void CefWebURLRequestClientCToCpp::OnHeadersReceived( void CefWebURLRequestClientCToCpp::OnProgress( CefRefPtr requester, uint64 bytesSent, - uint64 totalBytesToBeSent) -{ + uint64 totalBytesToBeSent) { if (CEF_MEMBER_MISSING(struct_, on_progress)) return; @@ -111,8 +107,7 @@ void CefWebURLRequestClientCToCpp::OnProgress( } void CefWebURLRequestClientCToCpp::OnData(CefRefPtr requester, - const void* data, int dataLength) -{ + const void* data, int dataLength) { if (CEF_MEMBER_MISSING(struct_, on_data)) return; @@ -135,8 +130,7 @@ void CefWebURLRequestClientCToCpp::OnData(CefRefPtr requester, } void CefWebURLRequestClientCToCpp::OnError( - CefRefPtr requester, ErrorCode errorCode) -{ + CefRefPtr requester, ErrorCode errorCode) { if (CEF_MEMBER_MISSING(struct_, on_error)) return; diff --git a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h index ba68f460a..f30707dbf 100644 --- a/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h +++ b/libcef_dll/ctocpp/web_urlrequest_client_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _WEBURLREQUESTCLIENT_CTOCPP_H -#define _WEBURLREQUESTCLIENT_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_URLREQUEST_CLIENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_WEB_URLREQUEST_CLIENT_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_web_urlrequest.h" #include "include/capi/cef_web_urlrequest_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed DLL-side only. class CefWebURLRequestClientCToCpp : public CefCToCpp -{ -public: - CefWebURLRequestClientCToCpp(cef_web_urlrequest_client_t* str) + cef_web_urlrequest_client_t> { + public: + explicit CefWebURLRequestClientCToCpp(cef_web_urlrequest_client_t* str) : CefCToCpp(str) {} virtual ~CefWebURLRequestClientCToCpp() {} @@ -53,6 +53,6 @@ public: ErrorCode errorCode) OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _WEBURLREQUESTCLIENT_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_WEB_URLREQUEST_CLIENT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc b/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc index 53dd09ba6..b99490e30 100644 --- a/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc +++ b/libcef_dll/ctocpp/web_urlrequest_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -18,8 +18,7 @@ // STATIC METHODS - Body may be edited by hand. CefRefPtr CefWebURLRequest::CreateWebURLRequest( - CefRefPtr request, CefRefPtr client) -{ + CefRefPtr request, CefRefPtr client) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: request; type: refptr_same @@ -43,8 +42,7 @@ CefRefPtr CefWebURLRequest::CreateWebURLRequest( // VIRTUAL METHODS - Body may be edited by hand. -void CefWebURLRequestCToCpp::Cancel() -{ +void CefWebURLRequestCToCpp::Cancel() { if (CEF_MEMBER_MISSING(struct_, cancel)) return; @@ -54,8 +52,7 @@ void CefWebURLRequestCToCpp::Cancel() struct_->cancel(struct_); } -CefWebURLRequest::RequestState CefWebURLRequestCToCpp::GetState() -{ +CefWebURLRequest::RequestState CefWebURLRequestCToCpp::GetState() { if (CEF_MEMBER_MISSING(struct_, get_state)) return WUR_STATE_UNSENT; diff --git a/libcef_dll/ctocpp/web_urlrequest_ctocpp.h b/libcef_dll/ctocpp/web_urlrequest_ctocpp.h index 73265d229..399e0a8c6 100644 --- a/libcef_dll/ctocpp/web_urlrequest_ctocpp.h +++ b/libcef_dll/ctocpp/web_urlrequest_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _WEBURLREQUEST_CTOCPP_H -#define _WEBURLREQUEST_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_URLREQUEST_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_WEB_URLREQUEST_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_web_urlrequest.h" #include "include/capi/cef_web_urlrequest_capi.h" @@ -29,10 +30,9 @@ // This class may be instantiated and accessed wrapper-side only. class CefWebURLRequestCToCpp : public CefCToCpp -{ -public: - CefWebURLRequestCToCpp(cef_web_urlrequest_t* str) + cef_web_urlrequest_t> { + public: + explicit CefWebURLRequestCToCpp(cef_web_urlrequest_t* str) : CefCToCpp(str) {} virtual ~CefWebURLRequestCToCpp() {} @@ -42,6 +42,6 @@ public: virtual RequestState GetState() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _WEBURLREQUEST_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_WEB_URLREQUEST_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.cc b/libcef_dll/ctocpp/write_handler_ctocpp.cc index 40fe0795a..df8f3db97 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/write_handler_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -15,8 +15,7 @@ // VIRTUAL METHODS - Body may be edited by hand. -size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) -{ +size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { if (CEF_MEMBER_MISSING(struct_, write)) return 0; @@ -37,8 +36,7 @@ size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) return _retval; } -int CefWriteHandlerCToCpp::Seek(long offset, int whence) -{ +int CefWriteHandlerCToCpp::Seek(int64 offset, int whence) { if (CEF_MEMBER_MISSING(struct_, seek)) return 0; @@ -53,22 +51,20 @@ int CefWriteHandlerCToCpp::Seek(long offset, int whence) return _retval; } -long CefWriteHandlerCToCpp::Tell() -{ +int64 CefWriteHandlerCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long _retval = struct_->tell(struct_); + int64 _retval = struct_->tell(struct_); // Return type: simple return _retval; } -int CefWriteHandlerCToCpp::Flush() -{ +int CefWriteHandlerCToCpp::Flush() { if (CEF_MEMBER_MISSING(struct_, flush)) return 0; diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.h b/libcef_dll/ctocpp/write_handler_ctocpp.h index de3fbf23e..95713abe9 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.h +++ b/libcef_dll/ctocpp/write_handler_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _WRITEHANDLER_CTOCPP_H -#define _WRITEHANDLER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ +#pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") -#else // BUILDING_CEF_SHARED +#else // BUILDING_CEF_SHARED #include "include/cef_stream.h" #include "include/capi/cef_stream_capi.h" @@ -25,21 +26,20 @@ // This class may be instantiated and accessed DLL-side only. class CefWriteHandlerCToCpp : public CefCToCpp -{ -public: - CefWriteHandlerCToCpp(cef_write_handler_t* str) + cef_write_handler_t> { + public: + explicit CefWriteHandlerCToCpp(cef_write_handler_t* str) : CefCToCpp( str) {} virtual ~CefWriteHandlerCToCpp() {} // CefWriteHandler methods virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(long offset, int whence) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual int Flush() OVERRIDE; }; -#endif // BUILDING_CEF_SHARED -#endif // _WRITEHANDLER_CTOCPP_H +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/libcef_dll/ctocpp/xml_reader_ctocpp.cc index 5323730b2..73f0724ad 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -17,8 +17,7 @@ // STATIC METHODS - Body may be edited by hand. CefRefPtr CefXmlReader::Create(CefRefPtr stream, - EncodingType encodingType, const CefString& URI) -{ + EncodingType encodingType, const CefString& URI) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: stream; type: refptr_same @@ -43,8 +42,7 @@ CefRefPtr CefXmlReader::Create(CefRefPtr stream, // VIRTUAL METHODS - Body may be edited by hand. -bool CefXmlReaderCToCpp::MoveToNextNode() -{ +bool CefXmlReaderCToCpp::MoveToNextNode() { if (CEF_MEMBER_MISSING(struct_, move_to_next_node)) return false; @@ -57,8 +55,7 @@ bool CefXmlReaderCToCpp::MoveToNextNode() return _retval?true:false; } -bool CefXmlReaderCToCpp::Close() -{ +bool CefXmlReaderCToCpp::Close() { if (CEF_MEMBER_MISSING(struct_, close)) return false; @@ -71,8 +68,7 @@ bool CefXmlReaderCToCpp::Close() return _retval?true:false; } -bool CefXmlReaderCToCpp::HasError() -{ +bool CefXmlReaderCToCpp::HasError() { if (CEF_MEMBER_MISSING(struct_, has_error)) return false; @@ -85,8 +81,7 @@ bool CefXmlReaderCToCpp::HasError() return _retval?true:false; } -CefString CefXmlReaderCToCpp::GetError() -{ +CefString CefXmlReaderCToCpp::GetError() { if (CEF_MEMBER_MISSING(struct_, get_error)) return CefString(); @@ -101,8 +96,7 @@ CefString CefXmlReaderCToCpp::GetError() return _retvalStr; } -CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() -{ +CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() { if (CEF_MEMBER_MISSING(struct_, get_type)) return XML_NODE_UNSUPPORTED; @@ -115,8 +109,7 @@ CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() return _retval; } -int CefXmlReaderCToCpp::GetDepth() -{ +int CefXmlReaderCToCpp::GetDepth() { if (CEF_MEMBER_MISSING(struct_, get_depth)) return 0; @@ -129,8 +122,7 @@ int CefXmlReaderCToCpp::GetDepth() return _retval; } -CefString CefXmlReaderCToCpp::GetLocalName() -{ +CefString CefXmlReaderCToCpp::GetLocalName() { if (CEF_MEMBER_MISSING(struct_, get_local_name)) return CefString(); @@ -145,8 +137,7 @@ CefString CefXmlReaderCToCpp::GetLocalName() return _retvalStr; } -CefString CefXmlReaderCToCpp::GetPrefix() -{ +CefString CefXmlReaderCToCpp::GetPrefix() { if (CEF_MEMBER_MISSING(struct_, get_prefix)) return CefString(); @@ -161,8 +152,7 @@ CefString CefXmlReaderCToCpp::GetPrefix() return _retvalStr; } -CefString CefXmlReaderCToCpp::GetQualifiedName() -{ +CefString CefXmlReaderCToCpp::GetQualifiedName() { if (CEF_MEMBER_MISSING(struct_, get_qualified_name)) return CefString(); @@ -177,8 +167,7 @@ CefString CefXmlReaderCToCpp::GetQualifiedName() return _retvalStr; } -CefString CefXmlReaderCToCpp::GetNamespaceURI() -{ +CefString CefXmlReaderCToCpp::GetNamespaceURI() { if (CEF_MEMBER_MISSING(struct_, get_namespace_uri)) return CefString(); @@ -193,8 +182,7 @@ CefString CefXmlReaderCToCpp::GetNamespaceURI() return _retvalStr; } -CefString CefXmlReaderCToCpp::GetBaseURI() -{ +CefString CefXmlReaderCToCpp::GetBaseURI() { if (CEF_MEMBER_MISSING(struct_, get_base_uri)) return CefString(); @@ -209,8 +197,7 @@ CefString CefXmlReaderCToCpp::GetBaseURI() return _retvalStr; } -CefString CefXmlReaderCToCpp::GetXmlLang() -{ +CefString CefXmlReaderCToCpp::GetXmlLang() { if (CEF_MEMBER_MISSING(struct_, get_xml_lang)) return CefString(); @@ -225,8 +212,7 @@ CefString CefXmlReaderCToCpp::GetXmlLang() return _retvalStr; } -bool CefXmlReaderCToCpp::IsEmptyElement() -{ +bool CefXmlReaderCToCpp::IsEmptyElement() { if (CEF_MEMBER_MISSING(struct_, is_empty_element)) return false; @@ -239,8 +225,7 @@ bool CefXmlReaderCToCpp::IsEmptyElement() return _retval?true:false; } -bool CefXmlReaderCToCpp::HasValue() -{ +bool CefXmlReaderCToCpp::HasValue() { if (CEF_MEMBER_MISSING(struct_, has_value)) return false; @@ -253,8 +238,7 @@ bool CefXmlReaderCToCpp::HasValue() return _retval?true:false; } -CefString CefXmlReaderCToCpp::GetValue() -{ +CefString CefXmlReaderCToCpp::GetValue() { if (CEF_MEMBER_MISSING(struct_, get_value)) return CefString(); @@ -269,8 +253,7 @@ CefString CefXmlReaderCToCpp::GetValue() return _retvalStr; } -bool CefXmlReaderCToCpp::HasAttributes() -{ +bool CefXmlReaderCToCpp::HasAttributes() { if (CEF_MEMBER_MISSING(struct_, has_attributes)) return false; @@ -283,8 +266,7 @@ bool CefXmlReaderCToCpp::HasAttributes() return _retval?true:false; } -size_t CefXmlReaderCToCpp::GetAttributeCount() -{ +size_t CefXmlReaderCToCpp::GetAttributeCount() { if (CEF_MEMBER_MISSING(struct_, get_attribute_count)) return 0; @@ -297,15 +279,14 @@ size_t CefXmlReaderCToCpp::GetAttributeCount() return _retval; } -CefString CefXmlReaderCToCpp::GetAttribute(int index) -{ +CefString CefXmlReaderCToCpp::GetAttribute(int index) { if (CEF_MEMBER_MISSING(struct_, get_attribute_byindex)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return CefString(); @@ -319,8 +300,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(int index) return _retvalStr; } -CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) -{ +CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { if (CEF_MEMBER_MISSING(struct_, get_attribute_byqname)) return CefString(); @@ -342,8 +322,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) } CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, - const CefString& namespaceURI) -{ + const CefString& namespaceURI) { if (CEF_MEMBER_MISSING(struct_, get_attribute_bylname)) return CefString(); @@ -369,8 +348,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, return _retvalStr; } -CefString CefXmlReaderCToCpp::GetInnerXml() -{ +CefString CefXmlReaderCToCpp::GetInnerXml() { if (CEF_MEMBER_MISSING(struct_, get_inner_xml)) return CefString(); @@ -385,8 +363,7 @@ CefString CefXmlReaderCToCpp::GetInnerXml() return _retvalStr; } -CefString CefXmlReaderCToCpp::GetOuterXml() -{ +CefString CefXmlReaderCToCpp::GetOuterXml() { if (CEF_MEMBER_MISSING(struct_, get_outer_xml)) return CefString(); @@ -401,8 +378,7 @@ CefString CefXmlReaderCToCpp::GetOuterXml() return _retvalStr; } -int CefXmlReaderCToCpp::GetLineNumber() -{ +int CefXmlReaderCToCpp::GetLineNumber() { if (CEF_MEMBER_MISSING(struct_, get_line_number)) return 0; @@ -415,15 +391,14 @@ int CefXmlReaderCToCpp::GetLineNumber() return _retval; } -bool CefXmlReaderCToCpp::MoveToAttribute(int index) -{ +bool CefXmlReaderCToCpp::MoveToAttribute(int index) { if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: index; type: simple_byval - DCHECK(index >= 0); + DCHECK_GE(index, 0); if (index < 0) return false; @@ -435,8 +410,7 @@ bool CefXmlReaderCToCpp::MoveToAttribute(int index) return _retval?true:false; } -bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) -{ +bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname)) return false; @@ -456,8 +430,7 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) } bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, - const CefString& namespaceURI) -{ + const CefString& namespaceURI) { if (CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname)) return false; @@ -481,8 +454,7 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, return _retval?true:false; } -bool CefXmlReaderCToCpp::MoveToFirstAttribute() -{ +bool CefXmlReaderCToCpp::MoveToFirstAttribute() { if (CEF_MEMBER_MISSING(struct_, move_to_first_attribute)) return false; @@ -495,8 +467,7 @@ bool CefXmlReaderCToCpp::MoveToFirstAttribute() return _retval?true:false; } -bool CefXmlReaderCToCpp::MoveToNextAttribute() -{ +bool CefXmlReaderCToCpp::MoveToNextAttribute() { if (CEF_MEMBER_MISSING(struct_, move_to_next_attribute)) return false; @@ -509,8 +480,7 @@ bool CefXmlReaderCToCpp::MoveToNextAttribute() return _retval?true:false; } -bool CefXmlReaderCToCpp::MoveToCarryingElement() -{ +bool CefXmlReaderCToCpp::MoveToCarryingElement() { if (CEF_MEMBER_MISSING(struct_, move_to_carrying_element)) return false; diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.h b/libcef_dll/ctocpp/xml_reader_ctocpp.h index 6a8d11878..e798ab063 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.h +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _XMLREADER_CTOCPP_H -#define _XMLREADER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_xml_reader.h" #include "include/capi/cef_xml_reader_capi.h" @@ -26,10 +27,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefXmlReaderCToCpp - : public CefCToCpp -{ -public: - CefXmlReaderCToCpp(cef_xml_reader_t* str) + : public CefCToCpp { + public: + explicit CefXmlReaderCToCpp(cef_xml_reader_t* str) : CefCToCpp(str) {} virtual ~CefXmlReaderCToCpp() {} @@ -67,6 +67,6 @@ public: virtual bool MoveToCarryingElement() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _XMLREADER_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/libcef_dll/ctocpp/zip_reader_ctocpp.cc index e160686db..44401ed48 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -16,8 +16,8 @@ // STATIC METHODS - Body may be edited by hand. -CefRefPtr CefZipReader::Create(CefRefPtr stream) -{ +CefRefPtr CefZipReader::Create( + CefRefPtr stream) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: stream; type: refptr_same @@ -36,8 +36,7 @@ CefRefPtr CefZipReader::Create(CefRefPtr stream) // VIRTUAL METHODS - Body may be edited by hand. -bool CefZipReaderCToCpp::MoveToFirstFile() -{ +bool CefZipReaderCToCpp::MoveToFirstFile() { if (CEF_MEMBER_MISSING(struct_, move_to_first_file)) return false; @@ -50,8 +49,7 @@ bool CefZipReaderCToCpp::MoveToFirstFile() return _retval?true:false; } -bool CefZipReaderCToCpp::MoveToNextFile() -{ +bool CefZipReaderCToCpp::MoveToNextFile() { if (CEF_MEMBER_MISSING(struct_, move_to_next_file)) return false; @@ -65,8 +63,7 @@ bool CefZipReaderCToCpp::MoveToNextFile() } bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, - bool caseSensitive) -{ + bool caseSensitive) { if (CEF_MEMBER_MISSING(struct_, move_to_file)) return false; @@ -86,8 +83,7 @@ bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, return _retval?true:false; } -bool CefZipReaderCToCpp::Close() -{ +bool CefZipReaderCToCpp::Close() { if (CEF_MEMBER_MISSING(struct_, close)) return false; @@ -100,8 +96,7 @@ bool CefZipReaderCToCpp::Close() return _retval?true:false; } -CefString CefZipReaderCToCpp::GetFileName() -{ +CefString CefZipReaderCToCpp::GetFileName() { if (CEF_MEMBER_MISSING(struct_, get_file_name)) return CefString(); @@ -116,22 +111,20 @@ CefString CefZipReaderCToCpp::GetFileName() return _retvalStr; } -long CefZipReaderCToCpp::GetFileSize() -{ +int64 CefZipReaderCToCpp::GetFileSize() { if (CEF_MEMBER_MISSING(struct_, get_file_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long _retval = struct_->get_file_size(struct_); + int64 _retval = struct_->get_file_size(struct_); // Return type: simple return _retval; } -time_t CefZipReaderCToCpp::GetFileLastModified() -{ +time_t CefZipReaderCToCpp::GetFileLastModified() { if (CEF_MEMBER_MISSING(struct_, get_file_last_modified)) return 0; @@ -144,8 +137,7 @@ time_t CefZipReaderCToCpp::GetFileLastModified() return _retval; } -bool CefZipReaderCToCpp::OpenFile(const CefString& password) -{ +bool CefZipReaderCToCpp::OpenFile(const CefString& password) { if (CEF_MEMBER_MISSING(struct_, open_file)) return false; @@ -161,8 +153,7 @@ bool CefZipReaderCToCpp::OpenFile(const CefString& password) return _retval?true:false; } -bool CefZipReaderCToCpp::CloseFile() -{ +bool CefZipReaderCToCpp::CloseFile() { if (CEF_MEMBER_MISSING(struct_, close_file)) return false; @@ -175,8 +166,7 @@ bool CefZipReaderCToCpp::CloseFile() return _retval?true:false; } -int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) -{ +int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { if (CEF_MEMBER_MISSING(struct_, read_file)) return 0; @@ -196,22 +186,20 @@ int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) return _retval; } -long CefZipReaderCToCpp::Tell() -{ +int64 CefZipReaderCToCpp::Tell() { if (CEF_MEMBER_MISSING(struct_, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - long _retval = struct_->tell(struct_); + int64 _retval = struct_->tell(struct_); // Return type: simple return _retval; } -bool CefZipReaderCToCpp::Eof() -{ +bool CefZipReaderCToCpp::Eof() { if (CEF_MEMBER_MISSING(struct_, eof)) return false; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.h b/libcef_dll/ctocpp/zip_reader_ctocpp.h index d19dfd495..fa66515dc 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.h +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // @@ -10,12 +10,13 @@ // for more information. // -#ifndef _ZIPREADER_CTOCPP_H -#define _ZIPREADER_CTOCPP_H +#ifndef CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ +#pragma once #ifndef USING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed wrapper-side only") -#else // USING_CEF_SHARED +#else // USING_CEF_SHARED #include "include/cef_zip_reader.h" #include "include/capi/cef_zip_reader_capi.h" @@ -26,10 +27,9 @@ // Wrap a C structure with a C++ class. // This class may be instantiated and accessed wrapper-side only. class CefZipReaderCToCpp - : public CefCToCpp -{ -public: - CefZipReaderCToCpp(cef_zip_reader_t* str) + : public CefCToCpp { + public: + explicit CefZipReaderCToCpp(cef_zip_reader_t* str) : CefCToCpp(str) {} virtual ~CefZipReaderCToCpp() {} @@ -40,15 +40,15 @@ public: bool caseSensitive) OVERRIDE; virtual bool Close() OVERRIDE; virtual CefString GetFileName() OVERRIDE; - virtual long GetFileSize() OVERRIDE; + virtual int64 GetFileSize() OVERRIDE; virtual time_t GetFileLastModified() OVERRIDE; virtual bool OpenFile(const CefString& password) OVERRIDE; virtual bool CloseFile() OVERRIDE; virtual int ReadFile(void* buffer, size_t bufferSize) OVERRIDE; - virtual long Tell() OVERRIDE; + virtual int64 Tell() OVERRIDE; virtual bool Eof() OVERRIDE; }; -#endif // USING_CEF_SHARED -#endif // _ZIPREADER_CTOCPP_H +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ diff --git a/libcef_dll/libcef_dll.cc b/libcef_dll/libcef_dll.cc index 0a1c637c9..66f14c8fe 100644 --- a/libcef_dll/libcef_dll.cc +++ b/libcef_dll/libcef_dll.cc @@ -80,8 +80,7 @@ // GLOBAL FUNCTIONS - Body may be edited by hand. CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings, - struct _cef_app_t* application) -{ + struct _cef_app_t* application) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: settings; type: struct_byref_const @@ -104,8 +103,7 @@ CEF_EXPORT int cef_initialize(const struct _cef_settings_t* settings, return _retval; } -CEF_EXPORT void cef_shutdown() -{ +CEF_EXPORT void cef_shutdown() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -113,83 +111,79 @@ CEF_EXPORT void cef_shutdown() #ifndef NDEBUG // Check that all wrapper objects have been destroyed - DCHECK(CefBrowserCppToC::DebugObjCt == 0); - DCHECK(CefContentFilterCToCpp::DebugObjCt == 0); - DCHECK(CefCookieVisitorCToCpp::DebugObjCt == 0); - DCHECK(CefDOMDocumentCppToC::DebugObjCt == 0); - DCHECK(CefDOMEventCppToC::DebugObjCt == 0); - DCHECK(CefDOMEventListenerCToCpp::DebugObjCt == 0); - DCHECK(CefDOMNodeCppToC::DebugObjCt == 0); - DCHECK(CefDOMVisitorCToCpp::DebugObjCt == 0); - DCHECK(CefDisplayHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefDownloadHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefDragDataCppToC::DebugObjCt == 0); - DCHECK(CefDragHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefFindHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefFocusHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefFrameCppToC::DebugObjCt == 0); - DCHECK(CefJSDialogHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefKeyboardHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefLifeSpanHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefLoadHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefMenuHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefPermissionHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefPostDataCppToC::DebugObjCt == 0); - DCHECK(CefPostDataElementCppToC::DebugObjCt == 0); - DCHECK(CefPrintHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefProxyHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefReadHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefRenderHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefRequestCppToC::DebugObjCt == 0); - DCHECK(CefRequestHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefResponseCppToC::DebugObjCt == 0); - DCHECK(CefSchemeHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefSchemeHandlerCallbackCppToC::DebugObjCt == 0); - DCHECK(CefSchemeHandlerFactoryCToCpp::DebugObjCt == 0); - DCHECK(CefStorageVisitorCToCpp::DebugObjCt == 0); - DCHECK(CefStreamReaderCppToC::DebugObjCt == 0); - DCHECK(CefStreamWriterCppToC::DebugObjCt == 0); - DCHECK(CefTaskCToCpp::DebugObjCt == 0); - DCHECK(CefV8AccessorCToCpp::DebugObjCt == 0); - DCHECK(CefV8ContextCppToC::DebugObjCt == 0); - DCHECK(CefV8ContextHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefV8ExceptionCppToC::DebugObjCt == 0); - DCHECK(CefV8HandlerCToCpp::DebugObjCt == 0); - DCHECK(CefV8ValueCppToC::DebugObjCt == 0); - DCHECK(CefWebURLRequestClientCToCpp::DebugObjCt == 0); - DCHECK(CefWebURLRequestCppToC::DebugObjCt == 0); - DCHECK(CefWriteHandlerCToCpp::DebugObjCt == 0); - DCHECK(CefXmlReaderCppToC::DebugObjCt == 0); - DCHECK(CefZipReaderCppToC::DebugObjCt == 0); -#endif // !NDEBUG + DCHECK_EQ(CefBrowserCppToC::DebugObjCt, 0); + DCHECK_EQ(CefContentFilterCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefCookieVisitorCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDOMDocumentCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDOMEventCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDOMEventListenerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDOMNodeCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDOMVisitorCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDisplayHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDownloadHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDragDataCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDragHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefFindHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefFocusHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefFrameCppToC::DebugObjCt, 0); + DCHECK_EQ(CefJSDialogHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefKeyboardHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefLifeSpanHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefLoadHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefMenuHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefPermissionHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefPostDataCppToC::DebugObjCt, 0); + DCHECK_EQ(CefPostDataElementCppToC::DebugObjCt, 0); + DCHECK_EQ(CefPrintHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefProxyHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefReadHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefRenderHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefRequestCppToC::DebugObjCt, 0); + DCHECK_EQ(CefRequestHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefResponseCppToC::DebugObjCt, 0); + DCHECK_EQ(CefSchemeHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefSchemeHandlerCallbackCppToC::DebugObjCt, 0); + DCHECK_EQ(CefSchemeHandlerFactoryCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefStorageVisitorCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefStreamReaderCppToC::DebugObjCt, 0); + DCHECK_EQ(CefStreamWriterCppToC::DebugObjCt, 0); + DCHECK_EQ(CefTaskCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefV8AccessorCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefV8ContextCppToC::DebugObjCt, 0); + DCHECK_EQ(CefV8ContextHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefV8ExceptionCppToC::DebugObjCt, 0); + DCHECK_EQ(CefV8HandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefV8ValueCppToC::DebugObjCt, 0); + DCHECK_EQ(CefWebURLRequestClientCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefWebURLRequestCppToC::DebugObjCt, 0); + DCHECK_EQ(CefWriteHandlerCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefXmlReaderCppToC::DebugObjCt, 0); + DCHECK_EQ(CefZipReaderCppToC::DebugObjCt, 0); +#endif // !NDEBUG } -CEF_EXPORT void cef_do_message_loop_work() -{ +CEF_EXPORT void cef_do_message_loop_work() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefDoMessageLoopWork(); } -CEF_EXPORT void cef_run_message_loop() -{ +CEF_EXPORT void cef_run_message_loop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefRunMessageLoop(); } -CEF_EXPORT void cef_quit_message_loop() -{ +CEF_EXPORT void cef_quit_message_loop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute CefQuitMessageLoop(); } -CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) -{ +CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: visitor; type: refptr_diff @@ -206,8 +200,7 @@ CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) } CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url, - int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) -{ + int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -230,8 +223,7 @@ CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url, } CEF_EXPORT int cef_set_cookie(const cef_string_t* url, - const struct _cef_cookie_t* cookie) -{ + const struct _cef_cookie_t* cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -258,8 +250,7 @@ CEF_EXPORT int cef_set_cookie(const cef_string_t* url, } CEF_EXPORT int cef_delete_cookies(const cef_string_t* url, - const cef_string_t* cookie_name) -{ + const cef_string_t* cookie_name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: url, cookie_name @@ -273,8 +264,7 @@ CEF_EXPORT int cef_delete_cookies(const cef_string_t* url, return _retval; } -CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) -{ +CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: path @@ -289,8 +279,7 @@ CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) CEF_EXPORT int cef_add_cross_origin_whitelist_entry( const cef_string_t* source_origin, const cef_string_t* target_protocol, - const cef_string_t* target_domain, int allow_target_subdomains) -{ + const cef_string_t* target_domain, int allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -319,8 +308,7 @@ CEF_EXPORT int cef_add_cross_origin_whitelist_entry( CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( const cef_string_t* source_origin, const cef_string_t* target_protocol, - const cef_string_t* target_domain, int allow_target_subdomains) -{ + const cef_string_t* target_domain, int allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -347,8 +335,7 @@ CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( return _retval; } -CEF_EXPORT int cef_clear_cross_origin_whitelist() -{ +CEF_EXPORT int cef_clear_cross_origin_whitelist() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -359,8 +346,7 @@ CEF_EXPORT int cef_clear_cross_origin_whitelist() } CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name, - int is_standard, int is_local, int is_display_isolated) -{ + int is_standard, int is_local, int is_display_isolated) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: scheme_name; type: string_byref_const @@ -381,8 +367,7 @@ CEF_EXPORT int cef_register_custom_scheme(const cef_string_t* scheme_name, CEF_EXPORT int cef_register_scheme_handler_factory( const cef_string_t* scheme_name, const cef_string_t* domain_name, - struct _cef_scheme_handler_factory_t* factory) -{ + struct _cef_scheme_handler_factory_t* factory) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: scheme_name; type: string_byref_const @@ -401,8 +386,7 @@ CEF_EXPORT int cef_register_scheme_handler_factory( return _retval; } -CEF_EXPORT int cef_clear_scheme_handler_factories() -{ +CEF_EXPORT int cef_clear_scheme_handler_factories() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -414,8 +398,7 @@ CEF_EXPORT int cef_clear_scheme_handler_factories() CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key, - struct _cef_storage_visitor_t* visitor) -{ + struct _cef_storage_visitor_t* visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: visitor; type: refptr_diff @@ -437,8 +420,7 @@ CEF_EXPORT int cef_visit_storage(enum cef_storage_type_t type, CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, const cef_string_t* origin, const cef_string_t* key, - const cef_string_t* value) -{ + const cef_string_t* value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: origin; type: string_byref_const @@ -466,8 +448,7 @@ CEF_EXPORT int cef_set_storage(enum cef_storage_type_t type, } CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, - const cef_string_t* origin, const cef_string_t* key) -{ + const cef_string_t* origin, const cef_string_t* key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: origin, key @@ -483,8 +464,7 @@ CEF_EXPORT int cef_delete_storage(enum cef_storage_type_t type, } CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, - const cef_string_t* path) -{ + const cef_string_t* path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: path @@ -498,8 +478,7 @@ CEF_EXPORT int cef_set_storage_path(enum cef_storage_type_t type, return _retval; } -CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) -{ +CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -510,8 +489,8 @@ CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId) return _retval; } -CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, struct _cef_task_t* task) -{ +CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, + struct _cef_task_t* task) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -529,8 +508,7 @@ CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, struct _cef_task_t* task) } CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, - struct _cef_task_t* task, long delay_ms) -{ + struct _cef_task_t* task, int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -549,8 +527,7 @@ CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, } CEF_EXPORT int cef_parse_url(const cef_string_t* url, - struct _cef_urlparts_t* parts) -{ + struct _cef_urlparts_t* parts) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -581,8 +558,7 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url, } CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, - cef_string_t* url) -{ + cef_string_t* url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: parts; type: struct_byref_const @@ -611,8 +587,7 @@ CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, } CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, - const cef_string_t* javascript_code, struct _cef_v8handler_t* handler) -{ + const cef_string_t* javascript_code, struct _cef_v8handler_t* handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: extension_name; type: string_byref_const diff --git a/libcef_dll/libcef_dll2.cc b/libcef_dll/libcef_dll2.cc index 34574507a..5c7b18acc 100644 --- a/libcef_dll/libcef_dll2.cc +++ b/libcef_dll/libcef_dll2.cc @@ -6,15 +6,13 @@ #include "include/cef_nplugin.h" #include "include/capi/cef_nplugin_capi.h" #include "include/cef_version.h" -#include "cef_logging.h" +#include "libcef_dll/cef_logging.h" -CEF_EXPORT int cef_build_revision() -{ +CEF_EXPORT int cef_build_revision() { return CEF_REVISION; } -CEF_EXPORT int cef_register_plugin(const cef_plugin_info_t* plugin_info) -{ +CEF_EXPORT int cef_register_plugin(const cef_plugin_info_t* plugin_info) { DCHECK(plugin_info); if (!plugin_info) return 0; diff --git a/libcef_dll/transfer_util.h b/libcef_dll/transfer_util.h index 7992dd392..88dff1a38 100644 --- a/libcef_dll/transfer_util.h +++ b/libcef_dll/transfer_util.h @@ -2,14 +2,16 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#ifndef _TRANSFER_UTIL_H -#define _TRANSFER_UTIL_H +#ifndef CEF_LIBCEF_DLL_TRANSFER_UTIL_H_ +#define CEF_LIBCEF_DLL_TRANSFER_UTIL_H_ +#pragma once + +#include +#include #include "include/internal/cef_string_list.h" #include "include/internal/cef_string_map.h" #include "include/internal/cef_string_multimap.h" -#include -#include // Copy contents from one list type to another. typedef std::vector StringList; @@ -32,4 +34,4 @@ void transfer_string_multimap_contents(cef_string_multimap_t fromMap, void transfer_string_multimap_contents(const StringMultimap& fromMap, cef_string_multimap_t toMap); -#endif // _TRANSFER_UTIL_H +#endif // CEF_LIBCEF_DLL_TRANSFER_UTIL_H_ diff --git a/libcef_dll/wrapper/cef_byte_read_handler.cc b/libcef_dll/wrapper/cef_byte_read_handler.cc index eb864ac7b..8ae5b2d8b 100644 --- a/libcef_dll/wrapper/cef_byte_read_handler.cc +++ b/libcef_dll/wrapper/cef_byte_read_handler.cc @@ -3,16 +3,15 @@ // can be found in the LICENSE file. #include "include/wrapper/cef_byte_read_handler.h" +#include #include "libcef_dll/cef_logging.h" CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size, CefRefPtr source) - : bytes_(bytes), size_(size), offset_(0), source_(source) -{ + : bytes_(bytes), size_(size), offset_(0), source_(source) { } -size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) -{ +size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) { AutoLock lock_scope(this); size_t s = (size_ - offset_) / size; size_t ret = std::min(n, s); @@ -21,25 +20,26 @@ size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) return ret; } -int CefByteReadHandler::Seek(long offset, int whence) -{ +int CefByteReadHandler::Seek(int64 offset, int whence) { int rv = -1L; AutoLock lock_scope(this); - switch(whence) { + switch (whence) { case SEEK_CUR: - if(offset_ + offset > size_) + if (offset_ + offset > size_ || offset_ + offset < 0) break; offset_ += offset; rv = 0; break; - case SEEK_END: - if(offset > static_cast(size_)) + case SEEK_END: { + int64 offset_abs = abs(offset); + if (offset_abs > size_) break; - offset_ = size_ - offset; + offset_ = size_ - offset_abs; rv = 0; break; + } case SEEK_SET: - if(offset > static_cast(size_)) + if (offset > size_ || offset < 0) break; offset_ = offset; rv = 0; @@ -49,14 +49,12 @@ int CefByteReadHandler::Seek(long offset, int whence) return rv; } -long CefByteReadHandler::Tell() -{ +int64 CefByteReadHandler::Tell() { AutoLock lock_scope(this); return offset_; } -int CefByteReadHandler::Eof() -{ +int CefByteReadHandler::Eof() { AutoLock lock_scope(this); return (offset_ >= size_); } diff --git a/libcef_dll/wrapper/cef_xml_object.cc b/libcef_dll/wrapper/cef_xml_object.cc index 7fd2b89b5..49b1ff586 100644 --- a/libcef_dll/wrapper/cef_xml_object.cc +++ b/libcef_dll/wrapper/cef_xml_object.cc @@ -9,18 +9,15 @@ namespace { -class CefXmlObjectLoader -{ -public: - CefXmlObjectLoader(CefRefPtr root_object) - : root_object_(root_object) - { +class CefXmlObjectLoader { + public: + explicit CefXmlObjectLoader(CefRefPtr root_object) + : root_object_(root_object) { } bool Load(CefRefPtr stream, CefXmlReader::EncodingType encodingType, - const CefString& URI) - { + const CefString& URI) { CefRefPtr reader( CefXmlReader::Create(stream, encodingType, URI)); if (!reader.get()) @@ -34,7 +31,7 @@ public: CefXmlReader::NodeType cur_type; std::stringstream cur_value; bool last_has_ns = false; - + queue.push_back(root_object_); do { @@ -50,7 +47,7 @@ public: // Add to the current value. cur_value << std::string(reader->GetOuterXml()); continue; - } else if(last_has_ns && reader->GetPrefix().empty()) { + } else if (last_has_ns && reader->GetPrefix().empty()) { if (!cur_object->HasChildren()) { // Start a new value because the last element has a namespace and // this element does not. @@ -83,11 +80,11 @@ public: do { new_object->SetAttributeValue(reader->GetQualifiedName(), reader->GetValue()); - } while(reader->MoveToNextAttribute()); + } while (reader->MoveToNextAttribute()); reader->MoveToCarryingElement(); } } - } else if(cur_type == XML_NODE_ELEMENT_END) { + } else if (cur_type == XML_NODE_ELEMENT_END) { if (cur_depth == value_depth) { // Ending an element that is already in the value. continue; @@ -117,8 +114,8 @@ public: // Set the current object to the previous object in the queue. cur_object = queue.back().get(); - } else if(cur_type == XML_NODE_TEXT || cur_type == XML_NODE_CDATA || - cur_type == XML_NODE_ENTITY_REFERENCE) { + } else if (cur_type == XML_NODE_TEXT || cur_type == XML_NODE_CDATA || + cur_type == XML_NODE_ENTITY_REFERENCE) { if (cur_depth == value_depth) { // Add to the current value. cur_value << std::string(reader->GetValue()); @@ -136,7 +133,7 @@ public: break; } } - } while(reader->MoveToNextNode()); + } while (reader->MoveToNextNode()); } if (reader->HasError()) { @@ -149,26 +146,23 @@ public: CefString GetLoadError() { return load_error_; } -private: + private: CefString load_error_; CefRefPtr root_object_; }; -} // namespace +} // namespace CefXmlObject::CefXmlObject(const CefString& name) - : name_(name), parent_(NULL) -{ + : name_(name), parent_(NULL) { } -CefXmlObject::~CefXmlObject() -{ +CefXmlObject::~CefXmlObject() { } bool CefXmlObject::Load(CefRefPtr stream, CefXmlReader::EncodingType encodingType, - const CefString& URI, CefString* loadError) -{ + const CefString& URI, CefString* loadError) { AutoLock lock_scope(this); Clear(); @@ -181,8 +175,7 @@ bool CefXmlObject::Load(CefRefPtr stream, return true; } -void CefXmlObject::Set(CefRefPtr object) -{ +void CefXmlObject::Set(CefRefPtr object) { DCHECK(object.get()); AutoLock lock_scope1(this); @@ -194,8 +187,7 @@ void CefXmlObject::Set(CefRefPtr object) } void CefXmlObject::Append(CefRefPtr object, - bool overwriteAttributes) -{ + bool overwriteAttributes) { DCHECK(object.get()); AutoLock lock_scope1(this); @@ -220,8 +212,7 @@ void CefXmlObject::Append(CefRefPtr object, } } -CefRefPtr CefXmlObject::Duplicate() -{ +CefRefPtr CefXmlObject::Duplicate() { CefRefPtr new_obj; { AutoLock lock_scope(this); @@ -231,15 +222,13 @@ CefRefPtr CefXmlObject::Duplicate() return new_obj; } -void CefXmlObject::Clear() -{ +void CefXmlObject::Clear() { AutoLock lock_scope(this); ClearChildren(); ClearAttributes(); } -CefString CefXmlObject::GetName() -{ +CefString CefXmlObject::GetName() { CefString name; { AutoLock lock_scope(this); @@ -248,8 +237,7 @@ CefString CefXmlObject::GetName() return name; } -bool CefXmlObject::SetName(const CefString& name) -{ +bool CefXmlObject::SetName(const CefString& name) { DCHECK(!name.empty()); if (name.empty()) return false; @@ -259,14 +247,12 @@ bool CefXmlObject::SetName(const CefString& name) return true; } -bool CefXmlObject::HasParent() -{ +bool CefXmlObject::HasParent() { AutoLock lock_scope(this); return (parent_ != NULL); } -CefRefPtr CefXmlObject::GetParent() -{ +CefRefPtr CefXmlObject::GetParent() { CefRefPtr parent; { AutoLock lock_scope(this); @@ -275,14 +261,12 @@ CefRefPtr CefXmlObject::GetParent() return parent; } -bool CefXmlObject::HasValue() -{ +bool CefXmlObject::HasValue() { AutoLock lock_scope(this); return !value_.empty(); } -CefString CefXmlObject::GetValue() -{ +CefString CefXmlObject::GetValue() { CefString value; { AutoLock lock_scope(this); @@ -291,8 +275,7 @@ CefString CefXmlObject::GetValue() return value; } -bool CefXmlObject::SetValue(const CefString& value) -{ +bool CefXmlObject::SetValue(const CefString& value) { AutoLock lock_scope(this); DCHECK(children_.empty()); if (!children_.empty()) @@ -301,20 +284,17 @@ bool CefXmlObject::SetValue(const CefString& value) return true; } -bool CefXmlObject::HasAttributes() -{ +bool CefXmlObject::HasAttributes() { AutoLock lock_scope(this); return !attributes_.empty(); } -size_t CefXmlObject::GetAttributeCount() -{ +size_t CefXmlObject::GetAttributeCount() { AutoLock lock_scope(this); return attributes_.size(); } -bool CefXmlObject::HasAttribute(const CefString& name) -{ +bool CefXmlObject::HasAttribute(const CefString& name) { if (name.empty()) return false; @@ -323,8 +303,7 @@ bool CefXmlObject::HasAttribute(const CefString& name) return (it != attributes_.end()); } -CefString CefXmlObject::GetAttributeValue(const CefString& name) -{ +CefString CefXmlObject::GetAttributeValue(const CefString& name) { DCHECK(!name.empty()); CefString value; if (!name.empty()) { @@ -337,8 +316,7 @@ CefString CefXmlObject::GetAttributeValue(const CefString& name) } bool CefXmlObject::SetAttributeValue(const CefString& name, - const CefString& value) -{ + const CefString& value) { DCHECK(!name.empty()); if (name.empty()) return false; @@ -353,33 +331,28 @@ bool CefXmlObject::SetAttributeValue(const CefString& name, return true; } -size_t CefXmlObject::GetAttributes(AttributeMap& attributes) -{ +size_t CefXmlObject::GetAttributes(AttributeMap& attributes) { AutoLock lock_scope(this); attributes = attributes_; return attributes_.size(); } -void CefXmlObject::ClearAttributes() -{ +void CefXmlObject::ClearAttributes() { AutoLock lock_scope(this); attributes_.clear(); } -bool CefXmlObject::HasChildren() -{ +bool CefXmlObject::HasChildren() { AutoLock lock_scope(this); return !children_.empty(); } -size_t CefXmlObject::GetChildCount() -{ +size_t CefXmlObject::GetChildCount() { AutoLock lock_scope(this); return children_.size(); } -bool CefXmlObject::HasChild(CefRefPtr child) -{ +bool CefXmlObject::HasChild(CefRefPtr child) { DCHECK(child.get()); AutoLock lock_scope(this); @@ -391,27 +364,25 @@ bool CefXmlObject::HasChild(CefRefPtr child) return false; } -bool CefXmlObject::AddChild(CefRefPtr child) -{ +bool CefXmlObject::AddChild(CefRefPtr child) { DCHECK(child.get()); if (!child.get()) return false; AutoLock lock_scope1(child); - + DCHECK(child->GetParent() == NULL); if (child->GetParent() != NULL) return false; AutoLock lock_scope2(this); - + children_.push_back(child); child->SetParent(this); return true; } -bool CefXmlObject::RemoveChild(CefRefPtr child) -{ +bool CefXmlObject::RemoveChild(CefRefPtr child) { DCHECK(child.get()); AutoLock lock_scope(this); @@ -426,15 +397,13 @@ bool CefXmlObject::RemoveChild(CefRefPtr child) return false; } -size_t CefXmlObject::GetChildren(ObjectVector& children) -{ +size_t CefXmlObject::GetChildren(ObjectVector& children) { AutoLock lock_scope(this); children = children_; return children_.size(); } -void CefXmlObject::ClearChildren() -{ +void CefXmlObject::ClearChildren() { AutoLock lock_scope(this); ObjectVector::iterator it = children_.begin(); for (; it != children_.end(); ++it) @@ -442,8 +411,7 @@ void CefXmlObject::ClearChildren() children_.clear(); } -CefRefPtr CefXmlObject::FindChild(const CefString& name) -{ +CefRefPtr CefXmlObject::FindChild(const CefString& name) { DCHECK(!name.empty()); if (name.empty()) return NULL; @@ -451,15 +419,14 @@ CefRefPtr CefXmlObject::FindChild(const CefString& name) AutoLock lock_scope(this); ObjectVector::const_iterator it = children_.begin(); for (; it != children_.end(); ++it) { - if((*it)->GetName() == name) + if ((*it)->GetName() == name) return (*it); } return NULL; } size_t CefXmlObject::FindChildren(const CefString& name, - ObjectVector& children) -{ + ObjectVector& children) { DCHECK(!name.empty()); if (name.empty()) return 0; @@ -469,7 +436,7 @@ size_t CefXmlObject::FindChildren(const CefString& name, AutoLock lock_scope(this); ObjectVector::const_iterator it = children_.begin(); for (; it != children_.end(); ++it) { - if((*it)->GetName() == name) { + if ((*it)->GetName() == name) { children.push_back(*it); ct++; } @@ -477,8 +444,7 @@ size_t CefXmlObject::FindChildren(const CefString& name, return ct; } -void CefXmlObject::SetParent(CefXmlObject* parent) -{ +void CefXmlObject::SetParent(CefXmlObject* parent) { AutoLock lock_scope(this); if (parent) { DCHECK(parent_ == NULL); diff --git a/libcef_dll/wrapper/cef_zip_archive.cc b/libcef_dll/wrapper/cef_zip_archive.cc index 21c4b6e67..787a714a8 100644 --- a/libcef_dll/wrapper/cef_zip_archive.cc +++ b/libcef_dll/wrapper/cef_zip_archive.cc @@ -2,24 +2,23 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "include/wrapper/cef_zip_archive.h" -#include "include/cef_stream.h" -#include "include/cef_zip_reader.h" -#include "include/wrapper/cef_byte_read_handler.h" -#include "libcef_dll/cef_logging.h" -#include -#include - #if defined(__linux__) #include #endif +#include +#include +#include "include/wrapper/cef_zip_archive.h" +#include "include/cef_stream.h" +#include "include/cef_zip_reader.h" +#include "include/wrapper/cef_byte_read_handler.h" +#include "libcef_dll/cef_logging.h" + namespace { -class CefZipFile : public CefZipArchive::File -{ -public: - CefZipFile(size_t size) : data_(size) {} +class CefZipFile : public CefZipArchive::File { + public: + explicit CefZipFile(size_t size) : data_(size) {} ~CefZipFile() {} // Returns the read-only data contained in the file. @@ -37,27 +36,24 @@ public: std::vector* GetDataVector() { return &data_; } -private: + private: std::vector data_; IMPLEMENT_REFCOUNTING(CefZipFile); }; -} // namespace +} // namespace // CefZipArchive implementation -CefZipArchive::CefZipArchive() -{ +CefZipArchive::CefZipArchive() { } -CefZipArchive::~CefZipArchive() -{ +CefZipArchive::~CefZipArchive() { } size_t CefZipArchive::Load(CefRefPtr stream, - bool overwriteExisting) -{ + bool overwriteExisting) { AutoLock lock_scope(this); CefRefPtr reader(CefZipReader::Create(stream)); @@ -82,7 +78,7 @@ size_t CefZipArchive::Load(CefRefPtr stream, if (!reader->OpenFile(CefString())) break; - + name = reader->GetFileName(); std::transform(name.begin(), name.end(), name.begin(), towlower); @@ -90,7 +86,7 @@ size_t CefZipArchive::Load(CefRefPtr stream, if (it != contents_.end()) { if (overwriteExisting) contents_.erase(it); - else // Skip files that already exist. + else // Skip files that already exist. continue; } @@ -115,20 +111,17 @@ size_t CefZipArchive::Load(CefRefPtr stream, return count; } -void CefZipArchive::Clear() -{ +void CefZipArchive::Clear() { AutoLock lock_scope(this); contents_.empty(); } -size_t CefZipArchive::GetFileCount() -{ +size_t CefZipArchive::GetFileCount() { AutoLock lock_scope(this); return contents_.size(); } -bool CefZipArchive::HasFile(const CefString& fileName) -{ +bool CefZipArchive::HasFile(const CefString& fileName) { std::wstring str = fileName; std::transform(str.begin(), str.end(), str.begin(), towlower); @@ -138,8 +131,7 @@ bool CefZipArchive::HasFile(const CefString& fileName) } CefRefPtr CefZipArchive::GetFile( - const CefString& fileName) -{ + const CefString& fileName) { std::wstring str = fileName; std::transform(str.begin(), str.end(), str.begin(), towlower); @@ -150,8 +142,7 @@ CefRefPtr CefZipArchive::GetFile( return NULL; } -bool CefZipArchive::RemoveFile(const CefString& fileName) -{ +bool CefZipArchive::RemoveFile(const CefString& fileName) { std::wstring str = fileName; std::transform(str.begin(), str.end(), str.begin(), towlower); @@ -164,9 +155,8 @@ bool CefZipArchive::RemoveFile(const CefString& fileName) return false; } -size_t CefZipArchive::GetFiles(FileMap& map) -{ - AutoLock lock_scope(this); - map = contents_; - return contents_.size(); +size_t CefZipArchive::GetFiles(FileMap& map) { + AutoLock lock_scope(this); + map = contents_; + return contents_.size(); } diff --git a/libcef_dll/wrapper/libcef_dll_wrapper.cc b/libcef_dll/wrapper/libcef_dll_wrapper.cc index 9987912e2..50d43b56f 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -84,8 +84,7 @@ // GLOBAL METHODS - Body may be edited by hand. CEF_GLOBAL bool CefInitialize(const CefSettings& settings, - CefRefPtr application) -{ + CefRefPtr application) { int build_revision = cef_build_revision(); if (build_revision != CEF_REVISION) { // The libcef build revision does not match the CEF API revision. @@ -106,8 +105,7 @@ CEF_GLOBAL bool CefInitialize(const CefSettings& settings, return _retval?true:false; } -CEF_GLOBAL void CefShutdown() -{ +CEF_GLOBAL void CefShutdown() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -115,83 +113,79 @@ CEF_GLOBAL void CefShutdown() #ifndef NDEBUG // Check that all wrapper objects have been destroyed - DCHECK(CefBrowserCToCpp::DebugObjCt == 0); - DCHECK(CefContentFilterCppToC::DebugObjCt == 0); - DCHECK(CefCookieVisitorCppToC::DebugObjCt == 0); - DCHECK(CefDOMDocumentCToCpp::DebugObjCt == 0); - DCHECK(CefDOMEventCToCpp::DebugObjCt == 0); - DCHECK(CefDOMEventListenerCppToC::DebugObjCt == 0); - DCHECK(CefDOMNodeCToCpp::DebugObjCt == 0); - DCHECK(CefDOMVisitorCppToC::DebugObjCt == 0); - DCHECK(CefDisplayHandlerCppToC::DebugObjCt == 0); - DCHECK(CefDownloadHandlerCppToC::DebugObjCt == 0); - DCHECK(CefDragDataCToCpp::DebugObjCt == 0); - DCHECK(CefDragHandlerCppToC::DebugObjCt == 0); - DCHECK(CefFindHandlerCppToC::DebugObjCt == 0); - DCHECK(CefFocusHandlerCppToC::DebugObjCt == 0); - DCHECK(CefFrameCToCpp::DebugObjCt == 0); - DCHECK(CefJSDialogHandlerCppToC::DebugObjCt == 0); - DCHECK(CefKeyboardHandlerCppToC::DebugObjCt == 0); - DCHECK(CefLifeSpanHandlerCppToC::DebugObjCt == 0); - DCHECK(CefLoadHandlerCppToC::DebugObjCt == 0); - DCHECK(CefMenuHandlerCppToC::DebugObjCt == 0); - DCHECK(CefPermissionHandlerCppToC::DebugObjCt == 0); - DCHECK(CefPostDataCToCpp::DebugObjCt == 0); - DCHECK(CefPostDataElementCToCpp::DebugObjCt == 0); - DCHECK(CefPrintHandlerCppToC::DebugObjCt == 0); - DCHECK(CefProxyHandlerCppToC::DebugObjCt == 0); - DCHECK(CefReadHandlerCppToC::DebugObjCt == 0); - DCHECK(CefRenderHandlerCppToC::DebugObjCt == 0); - DCHECK(CefRequestCToCpp::DebugObjCt == 0); - DCHECK(CefRequestHandlerCppToC::DebugObjCt == 0); - DCHECK(CefResponseCToCpp::DebugObjCt == 0); - DCHECK(CefSchemeHandlerCallbackCToCpp::DebugObjCt == 0); - DCHECK(CefSchemeHandlerCppToC::DebugObjCt == 0); - DCHECK(CefSchemeHandlerFactoryCppToC::DebugObjCt == 0); - DCHECK(CefStorageVisitorCppToC::DebugObjCt == 0); - DCHECK(CefStreamReaderCToCpp::DebugObjCt == 0); - DCHECK(CefStreamWriterCToCpp::DebugObjCt == 0); - DCHECK(CefTaskCppToC::DebugObjCt == 0); - DCHECK(CefV8AccessorCppToC::DebugObjCt == 0); - DCHECK(CefV8ContextCToCpp::DebugObjCt == 0); - DCHECK(CefV8ContextHandlerCppToC::DebugObjCt == 0); - DCHECK(CefV8ExceptionCToCpp::DebugObjCt == 0); - DCHECK(CefV8HandlerCppToC::DebugObjCt == 0); - DCHECK(CefV8ValueCToCpp::DebugObjCt == 0); - DCHECK(CefWebURLRequestCToCpp::DebugObjCt == 0); - DCHECK(CefWebURLRequestClientCppToC::DebugObjCt == 0); - DCHECK(CefWriteHandlerCppToC::DebugObjCt == 0); - DCHECK(CefXmlReaderCToCpp::DebugObjCt == 0); - DCHECK(CefZipReaderCToCpp::DebugObjCt == 0); -#endif // !NDEBUG + DCHECK_EQ(CefBrowserCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefContentFilterCppToC::DebugObjCt, 0); + DCHECK_EQ(CefCookieVisitorCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDOMDocumentCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDOMEventCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDOMEventListenerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDOMNodeCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDOMVisitorCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDisplayHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDownloadHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefDragDataCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefDragHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefFindHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefFocusHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefFrameCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefJSDialogHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefKeyboardHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefLifeSpanHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefLoadHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefMenuHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefPermissionHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefPostDataCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefPostDataElementCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefPrintHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefProxyHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefReadHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefRenderHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefRequestCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefRequestHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefResponseCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefSchemeHandlerCallbackCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefSchemeHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefSchemeHandlerFactoryCppToC::DebugObjCt, 0); + DCHECK_EQ(CefStorageVisitorCppToC::DebugObjCt, 0); + DCHECK_EQ(CefStreamReaderCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefStreamWriterCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefTaskCppToC::DebugObjCt, 0); + DCHECK_EQ(CefV8AccessorCppToC::DebugObjCt, 0); + DCHECK_EQ(CefV8ContextCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefV8ContextHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefV8ExceptionCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefV8HandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefV8ValueCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefWebURLRequestCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefWebURLRequestClientCppToC::DebugObjCt, 0); + DCHECK_EQ(CefWriteHandlerCppToC::DebugObjCt, 0); + DCHECK_EQ(CefXmlReaderCToCpp::DebugObjCt, 0); + DCHECK_EQ(CefZipReaderCToCpp::DebugObjCt, 0); +#endif // !NDEBUG } -CEF_GLOBAL void CefDoMessageLoopWork() -{ +CEF_GLOBAL void CefDoMessageLoopWork() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_do_message_loop_work(); } -CEF_GLOBAL void CefRunMessageLoop() -{ +CEF_GLOBAL void CefRunMessageLoop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_run_message_loop(); } -CEF_GLOBAL void CefQuitMessageLoop() -{ +CEF_GLOBAL void CefQuitMessageLoop() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute cef_quit_message_loop(); } -CEF_GLOBAL bool CefVisitAllCookies(CefRefPtr visitor) -{ +CEF_GLOBAL bool CefVisitAllCookies(CefRefPtr visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: visitor; type: refptr_diff @@ -208,8 +202,7 @@ CEF_GLOBAL bool CefVisitAllCookies(CefRefPtr visitor) } CEF_GLOBAL bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, - CefRefPtr visitor) -{ + CefRefPtr visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -231,8 +224,7 @@ CEF_GLOBAL bool CefVisitUrlCookies(const CefString& url, bool includeHttpOnly, return _retval?true:false; } -CEF_GLOBAL bool CefSetCookie(const CefString& url, const CefCookie& cookie) -{ +CEF_GLOBAL bool CefSetCookie(const CefString& url, const CefCookie& cookie) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -250,8 +242,7 @@ CEF_GLOBAL bool CefSetCookie(const CefString& url, const CefCookie& cookie) } CEF_GLOBAL bool CefDeleteCookies(const CefString& url, - const CefString& cookie_name) -{ + const CefString& cookie_name) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: url, cookie_name @@ -265,8 +256,7 @@ CEF_GLOBAL bool CefDeleteCookies(const CefString& url, return _retval?true:false; } -CEF_GLOBAL bool CefSetCookiePath(const CefString& path) -{ +CEF_GLOBAL bool CefSetCookiePath(const CefString& path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: path @@ -281,8 +271,7 @@ CEF_GLOBAL bool CefSetCookiePath(const CefString& path) CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, const CefString& target_protocol, const CefString& target_domain, - bool allow_target_subdomains) -{ + bool allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -311,8 +300,7 @@ CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( const CefString& source_origin, const CefString& target_protocol, - const CefString& target_domain, bool allow_target_subdomains) -{ + const CefString& target_domain, bool allow_target_subdomains) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: source_origin; type: string_byref_const @@ -339,8 +327,7 @@ CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( return _retval?true:false; } -CEF_GLOBAL bool CefClearCrossOriginWhitelist() -{ +CEF_GLOBAL bool CefClearCrossOriginWhitelist() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -351,8 +338,7 @@ CEF_GLOBAL bool CefClearCrossOriginWhitelist() } CEF_GLOBAL bool CefRegisterCustomScheme(const CefString& scheme_name, - bool is_standard, bool is_local, bool is_display_isolated) -{ + bool is_standard, bool is_local, bool is_display_isolated) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: scheme_name; type: string_byref_const @@ -372,8 +358,8 @@ CEF_GLOBAL bool CefRegisterCustomScheme(const CefString& scheme_name, } CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, - const CefString& domain_name, CefRefPtr factory) -{ + const CefString& domain_name, + CefRefPtr factory) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: scheme_name; type: string_byref_const @@ -392,8 +378,7 @@ CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, return _retval?true:false; } -CEF_GLOBAL bool CefClearSchemeHandlerFactories() -{ +CEF_GLOBAL bool CefClearSchemeHandlerFactories() { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -404,8 +389,7 @@ CEF_GLOBAL bool CefClearSchemeHandlerFactories() } CEF_GLOBAL bool CefVisitStorage(CefStorageType type, const CefString& origin, - const CefString& key, CefRefPtr visitor) -{ + const CefString& key, CefRefPtr visitor) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: visitor; type: refptr_diff @@ -426,8 +410,7 @@ CEF_GLOBAL bool CefVisitStorage(CefStorageType type, const CefString& origin, } CEF_GLOBAL bool CefSetStorage(CefStorageType type, const CefString& origin, - const CefString& key, const CefString& value) -{ + const CefString& key, const CefString& value) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: origin; type: string_byref_const @@ -455,8 +438,7 @@ CEF_GLOBAL bool CefSetStorage(CefStorageType type, const CefString& origin, } CEF_GLOBAL bool CefDeleteStorage(CefStorageType type, const CefString& origin, - const CefString& key) -{ + const CefString& key) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: origin, key @@ -471,8 +453,7 @@ CEF_GLOBAL bool CefDeleteStorage(CefStorageType type, const CefString& origin, return _retval?true:false; } -CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) -{ +CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Unverified params: path @@ -486,8 +467,7 @@ CEF_GLOBAL bool CefSetStoragePath(CefStorageType type, const CefString& path) return _retval?true:false; } -CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) -{ +CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -498,8 +478,7 @@ CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) return _retval?true:false; } -CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) -{ +CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -517,8 +496,7 @@ CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) } CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, - CefRefPtr task, long delay_ms) -{ + CefRefPtr task, int64 delay_ms) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: task; type: refptr_diff @@ -536,8 +514,7 @@ CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, return _retval?true:false; } -CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) -{ +CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: url; type: string_byref_const @@ -554,8 +531,7 @@ CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) return _retval?true:false; } -CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) -{ +CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute @@ -568,8 +544,7 @@ CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) } CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, - const CefString& javascript_code, CefRefPtr handler) -{ + const CefString& javascript_code, CefRefPtr handler) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Verify param: extension_name; type: string_byref_const diff --git a/libcef_dll/wrapper/libcef_dll_wrapper2.cc b/libcef_dll/wrapper/libcef_dll_wrapper2.cc index 4647f5d65..cb34a0a55 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper2.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper2.cc @@ -5,7 +5,6 @@ #include "include/cef_nplugin.h" #include "include/capi/cef_nplugin_capi.h" -bool CefRegisterPlugin(const CefPluginInfo& plugin_info) -{ +bool CefRegisterPlugin(const CefPluginInfo& plugin_info) { return cef_register_plugin(&plugin_info)?true:false; } diff --git a/tests/cefclient/binding_test.cpp b/tests/cefclient/binding_test.cpp index 4439a5808..b4e8971d6 100644 --- a/tests/cefclient/binding_test.cpp +++ b/tests/cefclient/binding_test.cpp @@ -2,18 +2,19 @@ // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. -#include "binding_test.h" +#include "cefclient/binding_test.h" +#include +#include +#include #include "include/cef_browser.h" #include "include/cef_frame.h" #include "include/cef_v8.h" -#include // Implementation of the V8 handler class for the "window.cef_test.Dump" // function. -class ClientV8FunctionHandler : public CefV8Handler -{ -public: +class ClientV8FunctionHandler : public CefV8Handler { + public: ClientV8FunctionHandler() {} virtual ~ClientV8FunctionHandler() {} @@ -23,17 +24,14 @@ public: CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, - CefString& exception) OVERRIDE - { - if(name == "Dump") - { + CefString& exception) OVERRIDE { + if (name == "Dump") { // The "Dump" function will return a human-readable dump of the input // arguments. std::stringstream stream; size_t i; - for(i = 0; i < arguments.size(); ++i) - { + for (i = 0; i < arguments.size(); ++i) { stream << "arg[" << i << "] = "; PrintValue(arguments[i], stream, 0); stream << "\n"; @@ -41,15 +39,13 @@ public: retval = CefV8Value::CreateString(stream.str()); return true; - } - else if(name == "Call") - { + } else if (name == "Call") { // The "Call" function will execute a function to get an object and then // return the result of calling a function belonging to that object. The // first arument is the function that will return an object and the second // argument is the function that will be called on that returned object. int argSize = arguments.size(); - if(argSize < 2 || !arguments[0]->IsFunction() + if (argSize < 2 || !arguments[0]->IsFunction() || !arguments[1]->IsString()) return false; @@ -68,7 +64,7 @@ public: return false; // Verify that the returned value is an object. - if(!objectPtr.get() || !objectPtr->IsObject()) + if (!objectPtr.get() || !objectPtr->IsObject()) return false; // Retrieve the member function specified by name in the second argument @@ -76,13 +72,13 @@ public: CefRefPtr funcPtr = objectPtr->GetValue(arguments[1]->GetStringValue()); // Verify that the returned value is a function. - if(!funcPtr.get() || !funcPtr->IsFunction()) + if (!funcPtr.get() || !funcPtr->IsFunction()) return false; // Pass any additional arguments on to the member function. - for(int i = 2; i < argSize; ++i) + for (int i = 2; i < argSize; ++i) argList.push_back(arguments[i]); - + // Execute the member function. result = funcPtr->ExecuteFunction(arguments[0], argList, retval, exceptionPtr, false); @@ -95,40 +91,39 @@ public: // Simple function for formatted output of a V8 value. void PrintValue(CefRefPtr value, std::stringstream &stream, - int indent) - { + int indent) { std::stringstream indent_stream; - for(int i = 0; i < indent; ++i) + for (int i = 0; i < indent; ++i) indent_stream << " "; std::string indent_str = indent_stream.str(); - - if(value->IsUndefined()) + + if (value->IsUndefined()) stream << "(undefined)"; - else if(value->IsNull()) + else if (value->IsNull()) stream << "(null)"; - else if(value->IsBool()) + else if (value->IsBool()) stream << "(bool) " << (value->GetBoolValue() ? "true" : "false"); - else if(value->IsInt()) + else if (value->IsInt()) stream << "(int) " << value->GetIntValue(); - else if(value->IsDouble()) + else if (value->IsDouble()) stream << "(double) " << value->GetDoubleValue(); - else if(value->IsString()) + else if (value->IsString()) stream << "(string) " << std::string(value->GetStringValue()); - else if(value->IsFunction()) + else if (value->IsFunction()) stream << "(function) " << std::string(value->GetFunctionName()); - else if(value->IsArray()) { + else if (value->IsArray()) { stream << "(array) ["; int len = value->GetArrayLength(); - for(int i = 0; i < len; ++i) { + for (int i = 0; i < len; ++i) { stream << "\n " << indent_str.c_str() << i << " = "; PrintValue(value->GetValue(i), stream, indent+1); } stream << "\n" << indent_str.c_str() << "]"; - } else if(value->IsObject()) { + } else if (value->IsObject()) { stream << "(object) ["; std::vector keys; - if(value->GetKeys(keys)) { - for(size_t i = 0; i < keys.size(); ++i) { + if (value->GetKeys(keys)) { + for (size_t i = 0; i < keys.size(); ++i) { stream << "\n " << indent_str.c_str() << keys[i].c_str() << " = "; PrintValue(value->GetValue(keys[i]), stream, indent+1); } @@ -143,8 +138,7 @@ public: void InitBindingTest(CefRefPtr browser, CefRefPtr frame, - CefRefPtr object) -{ + CefRefPtr object) { // Create the new V8 object. CefRefPtr testObjPtr = CefV8Value::CreateObject(NULL, NULL); // Add the new V8 object to the global window object with the name @@ -164,8 +158,7 @@ void InitBindingTest(CefRefPtr browser, V8_PROPERTY_ATTRIBUTE_NONE); } -void RunBindingTest(CefRefPtr browser) -{ +void RunBindingTest(CefRefPtr browser) { std::string html = "ClientV8FunctionHandler says:
"
     "\
-          \
-          Running execXMLHttpRequest...\
-          ";
+  ss << ""
+        ""
+        ""
+        "Running execXMLHttpRequest..."
+        "";
   g_TestResults.html = ss.str();
   g_TestResults.status_code = 200;
 
@@ -405,63 +389,61 @@ void SetUpXHR(const std::string& url, const std::string& sub_url,
 }
 
 void SetUpXSS(const std::string& url, const std::string& sub_url,
-              const std::string& domain = std::string())
-{
+              const std::string& domain = std::string()) {
   // 1. Load |url| which contains an iframe.
   // 2. The iframe loads |xss_url|.
   // 3. |xss_url| tries to call a JS function in |url|.
   // 4. |url| tries to call a JS function in |xss_url|.
-  
+
   std::stringstream ss;
   std::string domain_line;
   if (!domain.empty())
     domain_line = "document.domain = '" + domain + "';";
-  
+
   g_TestResults.sub_url = sub_url;
-  ss <<  "\
-          \
-          \
-          Running execXSSRequest...\
-          ";
+  ss << ""
+        ""
+        ""
+        "Running execXSSRequest..."
+        "";
   g_TestResults.sub_html = ss.str();
   g_TestResults.sub_status_code = 200;
 
   g_TestResults.url = url;
   ss.str("");
-  ss <<  "\
-          \
-          \
-          "
     "";
-    
+
     AddResource("http://tests/main.html", mainHtml.str(), "text/html");
-    
+
     std::stringstream iframeHtml;
     iframeHtml <<
     ""
@@ -665,9 +637,9 @@ public:
     "function calledFromMain() { fromIFrame(); }"
     ""
     "";
-    
+
     AddResource("http://tests/iframe.html", iframeHtml.str(), "text/html");
-    
+
     std::stringstream beginHtml;
     beginHtml <<
     ""
@@ -678,9 +650,9 @@ public:
     "begin(TestException, TestNavigate);"
     ""
     "";
-  	
+
     AddResource("http://tests/begin.html", beginHtml.str(), "text/html");
-    
+
     std::stringstream endHtml;
     endHtml <<
     ""
@@ -689,22 +661,20 @@ public:
     "end();"
     ""
     "";
-    
+
     AddResource("http://tests/end.html", endHtml.str(), "text/html");
-    
+
     CreateBrowser("http://tests/main.html");
   }
-  
+
   virtual void OnLoadEnd(CefRefPtr browser,
                          CefRefPtr frame,
-                         int httpStatusCode) OVERRIDE
-  {
+                         int httpStatusCode) OVERRIDE {
   }
-  
+
   virtual void OnContextCreated(CefRefPtr browser,
                                 CefRefPtr frame,
-                                CefRefPtr context) OVERRIDE
-  {
+                                CefRefPtr context) OVERRIDE {
     // Retrieve the 'window' object.
     CefRefPtr object = context->GetGlobal();
 
@@ -712,39 +682,39 @@ public:
     CefRefPtr currentBrowser = cc->GetBrowser();
     CefRefPtr currentFrame = cc->GetFrame();
     CefString currentURL = currentFrame->GetURL();
-    
+
     CefRefPtr ec = CefV8Context::GetEnteredContext();
     CefRefPtr enteredBrowser = ec->GetBrowser();
     CefRefPtr enteredFrame = ec->GetFrame();
     CefString enteredURL = enteredFrame->GetURL();
-    
+
     CefRefPtr funcHandler(new DelegatingV8Handler(this));
-    CefRefPtr helloFunc = 
+    CefRefPtr helloFunc =
         CefV8Value::CreateFunction("hello", funcHandler);
     object->SetValue("hello", helloFunc, V8_PROPERTY_ATTRIBUTE_NONE);
-    
-    CefRefPtr fromIFrameFunc = 
+
+    CefRefPtr fromIFrameFunc =
         CefV8Value::CreateFunction("fromIFrame", funcHandler);
     object->SetValue("fromIFrame", fromIFrameFunc, V8_PROPERTY_ATTRIBUTE_NONE);
-    
-    CefRefPtr goFunc = 
+
+    CefRefPtr goFunc =
         CefV8Value::CreateFunction("begin", funcHandler);
     object->SetValue("begin", goFunc, V8_PROPERTY_ATTRIBUTE_NONE);
-    
-    CefRefPtr doneFunc = 
+
+    CefRefPtr doneFunc =
         CefV8Value::CreateFunction("end", funcHandler);
     object->SetValue("end", doneFunc, V8_PROPERTY_ATTRIBUTE_NONE);
 
-    CefRefPtr compFunc = 
+    CefRefPtr compFunc =
         CefV8Value::CreateFunction("comp", funcHandler);
     object->SetValue("comp", compFunc, V8_PROPERTY_ATTRIBUTE_NONE);
 
     // Used for testing exceptions returned from accessors.
-    CefRefPtr gotGetExceptionFunc = 
+    CefRefPtr gotGetExceptionFunc =
         CefV8Value::CreateFunction("gotGetException", funcHandler);
     object->SetValue("gotGetException", gotGetExceptionFunc,
         V8_PROPERTY_ATTRIBUTE_NONE);
-    CefRefPtr gotSetExceptionFunc = 
+    CefRefPtr gotSetExceptionFunc =
         CefV8Value::CreateFunction("gotSetException", funcHandler);
     object->SetValue("gotSetException", gotSetExceptionFunc,
         V8_PROPERTY_ATTRIBUTE_NONE);
@@ -754,9 +724,9 @@ public:
     CefRefPtr accessor(new DelegatingV8Accessor(this));
     CefRefPtr point = CefV8Value::CreateObject(blankBase, accessor);
 
-    point->SetValue("x", V8_ACCESS_CONTROL_DEFAULT, 
+    point->SetValue("x", V8_ACCESS_CONTROL_DEFAULT,
         V8_PROPERTY_ATTRIBUTE_READONLY);
-    point->SetValue("y", V8_ACCESS_CONTROL_DEFAULT, 
+    point->SetValue("y", V8_ACCESS_CONTROL_DEFAULT,
         V8_PROPERTY_ATTRIBUTE_NONE);
 
     object->SetValue("point", point, V8_PROPERTY_ATTRIBUTE_NONE);
@@ -765,14 +735,13 @@ public:
     CefRefPtr exceptObj =
         CefV8Value::CreateObject(NULL, new DelegatingV8Accessor(this));
 
-    exceptObj->SetValue("makeException", V8_ACCESS_CONTROL_DEFAULT, 
+    exceptObj->SetValue("makeException", V8_ACCESS_CONTROL_DEFAULT,
         V8_PROPERTY_ATTRIBUTE_NONE);
 
     object->SetValue("exceptObj", exceptObj, V8_PROPERTY_ATTRIBUTE_NONE);
   }
-  
-  void CallIFrame()
-  {
+
+  void CallIFrame() {
     CefV8ValueList args;
     CefRefPtr rv;
     CefRefPtr exception;
@@ -781,15 +750,14 @@ public:
                                                         args, rv, exception,
                                                         false));
   }
-  
-  void AsyncTestContext(CefRefPtr ec, 
-                        CefRefPtr cc)
-  {
+
+  void AsyncTestContext(CefRefPtr ec,
+                        CefRefPtr cc) {
     // we should not be in a context in this call.
     CefRefPtr noContext = CefV8Context::GetCurrentContext();
     if (!noContext.get())
       got_no_context_.yes();
-    
+
     CefRefPtr enteredBrowser = ec->GetBrowser();
     CefRefPtr enteredFrame = ec->GetFrame();
     CefString enteredURL = enteredFrame->GetURL();
@@ -797,7 +765,7 @@ public:
     CefRefPtr enteredMainFrame = enteredBrowser->GetMainFrame();
     CefString enteredMainURL = enteredMainFrame->GetURL();
     CefString enteredMainName = enteredMainFrame->GetName();
-    
+
     CefRefPtr currentBrowser = cc->GetBrowser();
     CefRefPtr currentFrame = cc->GetFrame();
     CefString currentURL = currentFrame->GetURL();
@@ -805,43 +773,41 @@ public:
     CefRefPtr currentMainFrame = currentBrowser->GetMainFrame();
     CefString currentMainURL = currentMainFrame->GetURL();
     CefString currentMainName = currentMainFrame->GetName();
-    
-    CefRefPtr copyFromMainFrame = 
-    currentMainFrame->GetBrowser();
-    
+
+    CefRefPtr copyFromMainFrame =
+        currentMainFrame->GetBrowser();
+
     currentMainFrame->LoadURL("http://tests/begin.html");
   }
-  
+
   void AsyncTestException(CefRefPtr context,
-                          CefRefPtr func)
-  {
+                          CefRefPtr func) {
     CefV8ValueList args;
     CefRefPtr rv;
     CefRefPtr exception;
     CefRefPtr empty;
     ASSERT_TRUE(func->ExecuteFunctionWithContext(context, empty, args, rv,
                                                  exception, false));
-    if(exception.get() && exception->GetMessage() == "Uncaught My Exception")
+    if (exception.get() && exception->GetMessage() == "Uncaught My Exception")
       got_exception_.yes();
   }
-  
+
   void AsyncTestNavigation(CefRefPtr context,
-                           CefRefPtr func)
-  {
+                           CefRefPtr func) {
     CefRefPtr exception;
     CefV8ValueList args;
     CefRefPtr rv, obj, url;
 
-    // Need to enter the context in order to create an Object, 
-    // Array, or Function. Simple types like String, Int, 
-    // Boolean, and Double don't require you to be in the 
+    // Need to enter the context in order to create an Object,
+    // Array, or Function. Simple types like String, Int,
+    // Boolean, and Double don't require you to be in the
     // context before creating them.
     if ( context->Enter() ) {
       CefRefPtr global = context->GetGlobal();
       CefRefPtr anArray = CefV8Value::CreateArray();
       CefRefPtr funcHandler(new DelegatingV8Handler(this));
-      CefRefPtr foobarFunc = 
-        CefV8Value::CreateFunction("foobar", funcHandler);
+      CefRefPtr foobarFunc =
+          CefV8Value::CreateFunction("foobar", funcHandler);
 
       obj = CefV8Value::CreateObject(NULL, NULL);
       url = CefV8Value::CreateString("http://tests/end.html");
@@ -851,25 +817,24 @@ public:
       obj->SetValue("anArray", anArray, V8_PROPERTY_ATTRIBUTE_NONE);
 
       args.push_back(obj);
-  
+
       ASSERT_TRUE(func->ExecuteFunctionWithContext(context, global, args, rv,
                                                    exception, false));
-      if(!exception.get())
+      if (!exception.get())
         got_navigation_.yes();
-  
+
       context->Exit();
     }
   }
-  
-  bool Execute(const CefString& name, 
+
+  bool Execute(const CefString& name,
                CefRefPtr object,
                const CefV8ValueList& arguments,
                CefRefPtr& retval,
-               CefString& exception) OVERRIDE
-  {
+               CefString& exception) OVERRIDE {
     CefRefPtr cc = CefV8Context::GetCurrentContext();
     CefRefPtr ec = CefV8Context::GetEnteredContext();
-    
+
     CefRefPtr enteredBrowser = ec->GetBrowser();
     CefRefPtr enteredFrame = ec->GetFrame();
     CefString enteredURL = enteredFrame->GetURL();
@@ -877,7 +842,7 @@ public:
     CefRefPtr enteredMainFrame = enteredBrowser->GetMainFrame();
     CefString enteredMainURL = enteredMainFrame->GetURL();
     CefString enteredMainName = enteredMainFrame->GetName();
-    
+
     CefRefPtr currentBrowser = cc->GetBrowser();
     CefRefPtr currentFrame = cc->GetFrame();
     CefString currentURL = currentFrame->GetURL();
@@ -885,59 +850,58 @@ public:
     CefRefPtr currentMainFrame = currentBrowser->GetMainFrame();
     CefString currentMainURL = currentMainFrame->GetURL();
     CefString currentMainName = currentMainFrame->GetName();
-    
+
     if (name == "hello") {
-      if(arguments.size() == 2 && arguments[0]->IsString() &&
+      if (arguments.size() == 2 && arguments[0]->IsString() &&
          arguments[1]->IsFunction()) {
         CefString msg = arguments[0]->GetStringValue();
-        if(msg == "main") {
+        if (msg == "main") {
           got_hello_main_.yes();
           contextIFrame_ = cc;
           funcIFrame_ = arguments[1];
         }
-      } else if(arguments.size() == 1 && arguments[0]->IsString()) {
+      } else if (arguments.size() == 1 && arguments[0]->IsString()) {
         CefString msg = arguments[0]->GetStringValue();
-        if(msg == "iframe")
+        if (msg == "iframe")
           got_hello_iframe_.yes();
-      }
-      else
+      } else {
         return false;
-      
-      if(got_hello_main_ && got_hello_iframe_ && funcIFrame_->IsFunction()) {
+      }
+
+      if (got_hello_main_ && got_hello_iframe_ && funcIFrame_->IsFunction()) {
         // NB: At this point, enteredURL == http://tests/iframe.html which is
         // expected since the iframe made the call on its own. The unexpected
         // behavior is that in the call to fromIFrame (below) the enteredURL
-        // == http://tests/main.html even though the iframe.html context was 
+        // == http://tests/main.html even though the iframe.html context was
         // entered first.
-        //  -- Perhaps WebKit does something other than look at the bottom 
+        //  -- Perhaps WebKit does something other than look at the bottom
         //     of stack for the entered context.
-        if(enteredURL == "http://tests/iframe.html")
+        if (enteredURL == "http://tests/iframe.html")
           got_iframe_as_entered_url_.yes();
         CallIFrame();
       }
       return true;
-    } else if(name == "fromIFrame") {
-      if(enteredURL == "http://tests/main.html")
+    } else if (name == "fromIFrame") {
+      if (enteredURL == "http://tests/main.html")
         got_correct_entered_url_.yes();
-      if(currentURL == "http://tests/iframe.html")
+      if (currentURL == "http://tests/iframe.html")
         got_correct_current_url_.yes();
-      CefPostTask(TID_UI, NewCefRunnableMethod(this, 
+      CefPostTask(TID_UI, NewCefRunnableMethod(this,
           &TestContextHandler::AsyncTestContext, ec, cc));
       return true;
-    } else if(name == "begin") {
-      if(arguments.size() == 2 && arguments[0]->IsFunction() &&
+    } else if (name == "begin") {
+      if (arguments.size() == 2 && arguments[0]->IsFunction() &&
          arguments[1]->IsFunction()) {
         CefRefPtr funcException = arguments[0];
         CefRefPtr funcNavigate  = arguments[1];
-        CefPostTask(TID_UI, NewCefRunnableMethod(this, 
+        CefPostTask(TID_UI, NewCefRunnableMethod(this,
             &TestContextHandler::AsyncTestException, cc, funcException));
-        CefPostTask(TID_UI, NewCefRunnableMethod(this, 
+        CefPostTask(TID_UI, NewCefRunnableMethod(this,
             &TestContextHandler::AsyncTestNavigation, cc, funcNavigate));
         return true;
       }
     } else if (name == "comp") {
-      if(arguments.size() == 3)
-      {
+      if (arguments.size() == 3) {
         CefRefPtr expected = arguments[0];
         CefRefPtr one = arguments[1];
         CefRefPtr two = arguments[2];
@@ -949,9 +913,7 @@ public:
         // IsSame should match the expected
         if ( bExpected != bOne2Two || bExpected != bTwo2One)
           got_bad_is_same_.yes();
-      }
-      else
-      {
+      } else {
         got_bad_is_same_.yes();
       }
     } else if (name == "end") {
@@ -975,19 +937,18 @@ public:
   }
 
   bool Get(const CefString& name,
-           const CefRefPtr object, 
+           const CefRefPtr object,
            CefRefPtr& retval,
-           CefString& exception) OVERRIDE
-  {
-    if(name == "x") {
+           CefString& exception) OVERRIDE {
+    if (name == "x") {
       got_point_x_read_.yes();
       retval = CefV8Value::CreateInt(1234);
       return true;
-    } else if(name == "y") {
+    } else if (name == "y") {
       got_point_y_read_.yes();
       retval = CefV8Value::CreateInt(y_);
       return true;
-    } else if(name == "makeException") {
+    } else if (name == "makeException") {
       exception = "My Get Exception";
       return true;
     }
@@ -995,16 +956,15 @@ public:
   }
 
   bool Set(const CefString& name,
-           const CefRefPtr object, 
+           const CefRefPtr object,
            const CefRefPtr value,
-           CefString& exception) OVERRIDE
-  {
-    if(name == "y") {
+           CefString& exception) OVERRIDE {
+    if (name == "y") {
       y_ = value->GetIntValue();
-      if( y_ == 1234)
+      if (y_ == 1234)
         got_point_y_write_.yes();
       return true;
-    } else if(name == "makeException") {
+    } else if (name == "makeException") {
       exception = "My Set Exception";
       return true;
     }
@@ -1012,11 +972,11 @@ public:
   }
 
   // This function we will be called later to make it call into the
-  // IFRAME, which then calls "fromIFrame" so that we can check the 
+  // IFRAME, which then calls "fromIFrame" so that we can check the
   // entered vs current contexts are working as expected.
   CefRefPtr contextIFrame_;
   CefRefPtr funcIFrame_;
-  
+
   TrackCallback got_point_x_read_;
   TrackCallback got_point_y_read_;
   TrackCallback got_point_y_write_;
@@ -1036,17 +996,16 @@ public:
   int y_;
 };
 
-} // namespace
+}  // namespace
 
 // Verify context works to allow async v8 callbacks
-TEST(V8Test, Context)
-{
+TEST(V8Test, Context) {
   CefRefPtr handler = new TestContextHandler();
   handler->ExecuteTest();
 
-  EXPECT_TRUE(handler->got_point_x_read_);  
-  EXPECT_TRUE(handler->got_point_y_read_); 
-  EXPECT_TRUE(handler->got_point_y_write_); 
+  EXPECT_TRUE(handler->got_point_x_read_);
+  EXPECT_TRUE(handler->got_point_y_read_);
+  EXPECT_TRUE(handler->got_point_y_write_);
   EXPECT_FALSE(handler->got_bad_is_same_);
   EXPECT_TRUE(handler->got_hello_main_);
   EXPECT_TRUE(handler->got_hello_iframe_);
@@ -1063,19 +1022,15 @@ TEST(V8Test, Context)
 
 namespace {
 
-class TestInternalHandler : public TestHandler
-{
-public:
-  class UserData : public CefBase
-  {
-  public:
-    UserData(CefRefPtr test)
-      : test_(test)
-    {
+class TestInternalHandler : public TestHandler {
+ public:
+  class UserData : public CefBase {
+   public:
+    explicit UserData(CefRefPtr test)
+      : test_(test) {
     }
 
-    void Test(const std::string& name)
-    {
+    void Test(const std::string& name) {
       if (name == "obj1-before") {
         if (test_->nav_ == 0)
           test_->got_userdata_obj1_before_test1_fail_.yes();
@@ -1086,7 +1041,7 @@ public:
           test_->got_userdata_obj2_before_test1_.yes();
         else
           test_->got_userdata_obj2_before_test2_fail_.yes();
-      }else if (name == "obj1-after") {
+      } else if (name == "obj1-after") {
         if (test_->nav_ == 0)
           test_->got_userdata_obj1_after_test1_fail_.yes();
         else
@@ -1104,24 +1059,21 @@ public:
     IMPLEMENT_REFCOUNTING(UserData);
   };
 
-  class Accessor : public CefV8Accessor
-  {
-  public:
-    Accessor(CefRefPtr test)
-      : test_(test)
-    {
+  class Accessor : public CefV8Accessor {
+   public:
+    explicit Accessor(CefRefPtr test)
+      : test_(test) {
     }
 
     virtual bool Get(const CefString& name,
                      const CefRefPtr object,
                      CefRefPtr& retval,
-                     CefString& exception) OVERRIDE
-    {
+                     CefString& exception) OVERRIDE {
       if (test_->nav_ == 0)
         test_->got_accessor_get1_.yes();
       else
         test_->got_accessor_get2_fail_.yes();
-      
+
       retval = CefV8Value::CreateString("default2");
       return true;
     }
@@ -1129,13 +1081,12 @@ public:
     virtual bool Set(const CefString& name,
                      const CefRefPtr object,
                      const CefRefPtr value,
-                     CefString& exception) OVERRIDE
-    {
+                     CefString& exception) OVERRIDE {
       if (test_->nav_ == 0)
         test_->got_accessor_set1_.yes();
       else
         test_->got_accessor_set2_fail_.yes();
-      
+
       return true;
     }
 
@@ -1144,24 +1095,21 @@ public:
     IMPLEMENT_REFCOUNTING(Accessor);
   };
 
-  class Handler : public CefV8Handler
-  {
-  public:
-    Handler(CefRefPtr test)
+  class Handler : public CefV8Handler {
+   public:
+    explicit Handler(CefRefPtr test)
       : test_(test),
-        execute_ct_(0)
-    {
+        execute_ct_(0) {
     }
 
     virtual bool Execute(const CefString& name,
                          CefRefPtr object,
                          const CefV8ValueList& arguments,
                          CefRefPtr& retval,
-                         CefString& exception) OVERRIDE
-    {
+                         CefString& exception) OVERRIDE {
       CefRefPtr handler =
           object->GetValue("func")->GetFunctionHandler();
-           
+
       if (execute_ct_ == 0) {
         if (handler.get() == this)
           test_->got_execute1_.yes();
@@ -1185,20 +1133,17 @@ public:
     IMPLEMENT_REFCOUNTING(Accessor);
   };
 
-  class TestHandler : public CefV8Handler
-  {
-  public:
-    TestHandler(CefRefPtr test)
-      : test_(test)
-    {
+  class TestHandler : public CefV8Handler {
+   public:
+    explicit TestHandler(CefRefPtr test)
+      : test_(test) {
     }
 
     virtual bool Execute(const CefString& name,
                          CefRefPtr object,
                          const CefV8ValueList& arguments,
                          CefRefPtr& retval,
-                         CefString& exception) OVERRIDE
-    {
+                         CefString& exception) OVERRIDE {
       if (name == "store") {
         // Store a JSON value.
         if (arguments.size() == 2 && arguments[0]->IsString() &&
@@ -1307,14 +1252,12 @@ public:
 
     IMPLEMENT_REFCOUNTING(TestHandler);
   };
-  
+
   TestInternalHandler()
-    : nav_(0)
-  {
+    : nav_(0) {
   }
 
-  virtual void RunTest() OVERRIDE
-  {
+  virtual void RunTest() OVERRIDE {
     std::string tests =
         // Test userdata retrieval.
         "window.test.userdata('obj1-before', window.obj1);\n"
@@ -1362,9 +1305,9 @@ public:
         "window.func();\n"
         "\n"
         "";
-	  AddResource("http://tests/run1.html", testHtml.str(), "text/html");
+    AddResource("http://tests/run1.html", testHtml.str(), "text/html");
     testHtml.str("");
-    
+
     testHtml <<
         "\n"
         "\n"
         "";
-	  AddResource("http://tests/run2.html", testHtml.str(), "text/html");
+    AddResource("http://tests/run2.html", testHtml.str(), "text/html");
     testHtml.str("");
 
     CreateBrowser("http://tests/run1.html");
@@ -1383,8 +1326,7 @@ public:
 
   virtual void OnLoadEnd(CefRefPtr browser,
                          CefRefPtr frame,
-                         int httpStatusCode) OVERRIDE
-  {
+                         int httpStatusCode) OVERRIDE {
     if (nav_ == 0) {
       // Navigate to the next page.
       frame->LoadURL("http://tests/run2.html");
@@ -1397,8 +1339,7 @@ public:
 
   virtual void OnContextCreated(CefRefPtr browser,
                                 CefRefPtr frame,
-                                CefRefPtr context) OVERRIDE
-  {
+                                CefRefPtr context) OVERRIDE {
     // Retrieve the 'window' object.
     CefRefPtr object = context->GetGlobal();
 
@@ -1410,7 +1351,7 @@ public:
       obj1->SetValue("value2", CefV8Value::CreateString("default1"),
           V8_PROPERTY_ATTRIBUTE_NONE);
       object->SetValue("obj1", obj1, V8_PROPERTY_ATTRIBUTE_NONE);
-      
+
       // Create an object with Cef::Accessor and Cef::UserData internal values.
       CefRefPtr obj2 =
           CefV8Value::CreateObject(new UserData(this), new Accessor(this));
@@ -1471,7 +1412,7 @@ public:
   TrackCallback got_userdata_obj2_after_null2_;
   TrackCallback got_userdata_obj1_after_test2_fail_;
   TrackCallback got_userdata_obj2_after_test2_fail_;
-  
+
   TrackCallback got_accessor_get1_;
   TrackCallback got_accessor_get2_fail_;
   TrackCallback got_accessor_set1_;
@@ -1485,11 +1426,10 @@ public:
   TrackCallback got_execute2_fail_;
 };
 
-} // namespace
+}  // namespace
 
 // Test that messing around with CEF internal values doesn't cause crashes.
-TEST(V8Test, Internal)
-{
+TEST(V8Test, Internal) {
   CefRefPtr handler = new TestInternalHandler();
   handler->ExecuteTest();
 
@@ -1537,23 +1477,19 @@ namespace {
 
 static const int kNumExceptionTests = 3;
 
-class TestExceptionHandler : public TestHandler
-{
-public:
-  class TestHandler : public CefV8Handler
-  {
-  public:
-    TestHandler(CefRefPtr test)
-      : test_(test)
-    {
+class TestExceptionHandler : public TestHandler {
+ public:
+  class TestHandler : public CefV8Handler {
+   public:
+    explicit TestHandler(CefRefPtr test)
+      : test_(test) {
     }
 
     virtual bool Execute(const CefString& name,
                          CefRefPtr object,
                          const CefV8ValueList& arguments,
                          CefRefPtr& retval,
-                         CefString& exception) OVERRIDE
-    {
+                         CefString& exception) OVERRIDE {
       if (name == "register") {
         if (arguments.size() == 1 && arguments[0]->IsFunction()) {
           test_->got_register_.yes();
@@ -1593,13 +1529,11 @@ public:
 
     IMPLEMENT_REFCOUNTING(TestHandler);
   };
-  
-  TestExceptionHandler()
-  {
+
+  TestExceptionHandler() {
   }
 
-  virtual void RunTest() OVERRIDE
-  {
+  virtual void RunTest() OVERRIDE {
     std::string testHtml =
         "\n"
         "