0

Move some files from base to base/memory.

raw_scoped_refptr_mismatch_checker.h
ref_counted.cc
ref_counted.h
ref_counted_memory.cc
ref_counted_memory.h
ref_counted_unittest.cc
scoped_callback_factory.h
scoped_comptr_win.h
scoped_handle.h
scoped_native_library.cc
scoped_native_library.h
scoped_native_library_unittest.cc
scoped_nsobject.h
scoped_open_process.h
scoped_ptr.h
scoped_ptr_unittest.cc
scoped_temp_dir.cc
scoped_temp_dir.h
scoped_temp_dir_unittest.cc
scoped_vector.h
singleton.h
singleton_objc.h
singleton_unittest.cc
linked_ptr.h
linked_ptr_unittest.cc
weak_ptr.cc
weak_ptr.h
weak_ptr_unittest.cc

BUG=None
TEST=Compile

Review URL: http://codereview.chromium.org/6714032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
levin@chromium.org
2011-03-28 01:54:15 +00:00
parent 9174a10850
commit 3b63f8f451
2410 changed files with 4880 additions and 4852 deletions
app
base
atomic_ref_count.hbase.gypbase.gypibase_paths_linux.cccallback_internal.hcallback_old.hcallback_unittest.cccommand_line.cc
crypto
debug
environment.ccenvironment_unittest.ccfile_util.hfile_util_posix.ccfile_util_proxy.hfile_util_unittest.ccfile_version_info_mac.hfile_version_info_unittest.ccfile_version_info_win.hglobal_descriptors_posix.hhmac.hhmac_nss.cchmac_openssl.cc
i18n
json
linux_util.cclogging_win.cc
mac
memory
message_loop.hmessage_loop_proxy.hmessage_loop_proxy_impl_unittest.ccmessage_loop_unittest.ccmessage_pump.hmessage_pump_glib.hmessage_pump_glib_unittest.ccmessage_pump_libevent.cc
metrics
mime_util_xdg.ccnss_util.ccobserver_list_threadsafe.hobserver_list_unittest.ccopenssl_util.ccpickle_unittest.ccplatform_file_unittest.ccprocess_util_posix.ccprocess_util_unittest.ccprocess_util_win.ccprocess_win.ccref_counted.hscoped_ptr.hshared_memory_unittest.ccstack_container_unittest.ccstring_util.cc
synchronization
sys_info_win.cctask.htask_queue_unittest.cctask_unittest.cc
test
threading
time_win.cctimer_unittest.ccvalues_unittest.ccversion_unittest.cc
win
chrome
app
browser
about_flags.cc
accessibility
aeropeek_manager.ccapp_controller_mac.happ_controller_mac_unittest.mm
autocomplete
autocomplete_history_manager_unittest.cc
autofill
automation
background_application_list_model_unittest.ccbackground_contents_service_unittest.ccbackground_mode_manager_unittest.ccbackground_page_tracker.h
bookmarks
browser_about_handler.ccbrowser_about_handler_unittest.ccbrowser_encoding_uitest.ccbrowser_main.hbrowser_main_mac.mmbrowser_main_win.ccbrowser_process.hbrowser_process_impl.hbrowser_signin.ccbrowser_signin.hbrowsing_data_appcache_helper.hbrowsing_data_database_helper.hbrowsing_data_indexed_db_helper.ccbrowsing_data_indexed_db_helper.hbrowsing_data_indexed_db_helper_browsertest.ccbrowsing_data_local_storage_helper.hbrowsing_data_local_storage_helper_browsertest.ccbrowsing_data_remover.hbug_report_util.cccharacter_encoding.ccchrome_browser_application_mac.mm
chromeos
audio_handler.ccaudio_handler.haudio_mixer_alsa.hbrightness_bubble.cc
cros
cros_settings.hcustomization_document.hexternal_metrics_unittest.cc
frame
gview_request_interceptor.cc
input_method
locale_change_guard.h
login
network_state_notifier.h
notifications
plugin_selection_policy.hplugin_selection_policy_unittest.ccproxy_config_service_impl.hproxy_cros_settings_provider.h
status
system_key_event_listener.hupdate_browsertest.ccusb_mount_observer.ccusb_mount_observer_browsertest.ccuser_cros_settings_provider.ccvolume_bubble.cc
webui
wm_ipc.ccwm_message_listener.hwm_overview_controller.ccwm_overview_controller.h
cocoa
content_exceptions_table_model.h
content_settings
cookies_tree_model.cccookies_tree_model.hcrash_handler_host_linux.cccrash_handler_host_linux.hcrash_handler_host_linux_stub.cccrash_upload_list.h
custom_handlers
debugger
diagnostics
download
enumerate_modules_model_win.h
extensions
convert_user_script.ccconvert_user_script.hconvert_user_script_unittest.ccconvert_web_app.ccconvert_web_app.hconvert_web_app_unittest.cccrx_installer.cccrx_installer.hextension_accessibility_api.hextension_bookmarks_module.hextension_browsertests_misc.ccextension_cookies_api.hextension_creator.ccextension_data_deleter.hextension_debugger_api.ccextension_devtools_bridge.hextension_devtools_browsertests.ccextension_devtools_manager.hextension_event_router.hextension_event_router_forwarder.hextension_function.hextension_function_dispatcher.ccextension_function_dispatcher.hextension_history_api.hextension_host.ccextension_host.hextension_info_map.hextension_info_private_api_chromeos.hextension_management_api.hextension_management_browsertest.ccextension_menu_manager.hextension_menu_manager_unittest.ccextension_message_service.hextension_pref_value_map_unittest.ccextension_preference_api.ccextension_prefs.hextension_prefs_unittest.ccextension_process_manager.hextension_proxy_api.hextension_rlz_module.ccextension_service.hextension_service_unittest.ccextension_service_unittest.hextension_tab_id_map.hextension_test_api.ccextension_tts_api.hextension_tts_api_chromeos.ccextension_tts_api_linux.ccextension_tts_api_mac.mmextension_tts_api_win.ccextension_updater.hextension_updater_unittest.ccextension_web_ui.hextension_webnavigation_api.hextension_webrequest_api.hextensions_quota_service.hextensions_startup.hextensions_ui.ccextensions_ui.hexternal_extension_loader.hexternal_extension_provider_impl.ccexternal_extension_provider_impl.hexternal_extension_provider_interface.hexternal_pref_extension_loader.hfile_reader.himage_loading_tracker.hpack_extension_job.hsandboxed_extension_unpacker.ccsandboxed_extension_unpacker.hsandboxed_extension_unpacker_unittest.cctest_extension_prefs.cctest_extension_prefs.huser_script_listener.huser_script_master.h
external_tab_container_win.hfavicon_helper.ccfavicon_helper.hfavicon_service.h
first_run
geolocation
google
gpu_data_manager.hgpu_process_host_ui_shim.h
history
icon_loader.hicon_manager.cc
importer
instant
io_thread.hjankometer.ccjumplist_win.hmach_broker_mac.hmemory_details.h
metrics
mock_browsing_data_indexed_db_helper.h
nacl_host
net
notifications
parsers
password_manager
password_manager_delegate_impl.ccplugin_data_remover.hplugin_data_remover_helper.ccplugin_data_remover_helper.hplugin_updater.ccplugin_updater.h
policy
prefs
prerender
printing
process_singleton.hprocess_singleton_uitest.ccprofile_import_process_host.h
profiles
remoting
renderer_host
safe_browsing
search_engines
service
sessions
shell_integration.hshell_integration_linux.ccshell_integration_unittest.cc
sidebar
speech
spellcheck_host.hspellcheck_host_impl.h
ssl
status_icons
sync
abstract_profile_sync_service_test.h
engine
glue
js_arg_list.ccjs_arg_list.hjs_arg_list_unittest.cc
notifier
profile_sync_factory_impl_unittest.ccprofile_sync_factory_mock.hprofile_sync_service.hprofile_sync_service_autofill_unittest.ccprofile_sync_service_session_unittest.ccprofile_sync_service_startup_unittest.ccprofile_sync_service_typed_url_unittest.ccprofile_sync_service_unittest.ccprofile_sync_test_util.h
protocol
sessions
signin_manager.hsync_setup_wizard.ccsync_setup_wizard_unittest.ccsync_ui_util_mac_unittest.mm
syncable
tools
util
tab_contents
tabs
task_manager
themes
translate
transport_security_persister.h
ui
app_modal_dialogs
browser.hbrowser_init.cc
cocoa
about_ipc_controller.habout_ipc_controller_unittest.mmabout_window_controller_unittest.mmaccelerators_cocoa.haccelerators_cocoa.mmaccelerators_cocoa_unittest.mmanimatable_image.hanimatable_view.hanimatable_view_unittest.mm
applescript
background_gradient_view_unittest.mmbackground_tile_view_unittest.mmbase_bubble_controller.hbase_bubble_controller.mmbase_view.hbase_view_unittest.mm
bookmarks
browser_frame_view_unittest.mmbrowser_window_cocoa.hbrowser_window_cocoa_unittest.mmbrowser_window_controller.hbrowser_window_controller.mmbrowser_window_controller_private.mmbrowser_window_controller_unittest.mmbubble_view.hbubble_view_unittest.mmbug_report_window_controller.hbug_report_window_controller_unittest.mmchrome_event_processing_window.hchrome_event_processing_window_unittest.mmclickhold_button_cell.hclickhold_button_cell_unittest.mmcocoa_test_helper.hcommand_observer_bridge_unittest.mmconfirm_quit_panel_controller.mmconfirm_quit_panel_controller_unittest.mmconstrained_html_delegate_mac.mmconstrained_window_mac.h
content_settings
dev_tools_controller.hdock_icon.mm
download
draggable_button.mmdraggable_button_unittest.mm
extensions
fast_resize_view_unittest.mm
find_bar
find_pasteboard.hfind_pasteboard_unittest.mmfirst_run_bubble_controller_unittest.mmfirst_run_dialog.mmfocus_tracker.hfocus_tracker_unittest.mmframed_browser_window.hframed_browser_window_unittest.mmfullscreen_window_unittest.mmgradient_button_cell.hgradient_button_cell.mmgradient_button_cell_unittest.mmhistory_menu_bridge.hhistory_menu_bridge_unittest.mmhistory_menu_cocoa_controller.mmhistory_menu_cocoa_controller_unittest.mmhover_button.hhover_close_button.hhover_close_button.mmhover_image_button.hhover_image_button.mmhover_image_button_unittest.mmhtml_dialog_window_controller.hhtml_dialog_window_controller.mmhung_renderer_controller.hhung_renderer_controller_unittest.mmhyperlink_button_cell.hhyperlink_button_cell_unittest.mm
importer
info_bubble_view.mminfo_bubble_view_unittest.mminfo_bubble_window.hinfo_bubble_window.mminfo_bubble_window_unittest.mm
infobars
js_modal_dialog_cocoa.h
location_bar
menu_button.hmenu_button.mmmenu_button_unittest.mmmenu_controller.hnew_tab_button.h
notifications
nsmenuitem_additions_unittest.mmobjc_method_swizzle.mmobjc_method_swizzle_unittest.mmpage_info_bubble_controller.hpage_info_bubble_controller_unittest.mmrepost_form_warning_mac.hrepost_form_warning_mac.mmsearch_engine_dialog_controller.hshell_dialogs_mac.mmsidebar_controller.hssl_client_certificate_selector.mmstatus_bubble_mac_unittest.mm
status_icons
styled_text_field_cell_unittest.mmstyled_text_field_unittest.mm
tab_contents
tab_view_picker_table.htab_view_picker_table_unittest.mmtable_model_array_controller.htable_row_nsimage_cache.htabpose_window.htabpose_window.mm
tabs
task_manager_mac.htask_manager_mac_unittest.mmtheme_install_bubble_view.mm
toolbar
tracking_area.htracking_area_unittest.mm
translate
vertical_gradient_view.hvertical_gradient_view_unittest.mmwindow_size_autosaver_unittest.mm
wrench_menu
crypto_module_password_dialog.h
find_bar
gtk
input_window_dialog_gtk.cc
login
search_engines
shell_dialogs.h
tab_contents
tests
toolbar
touch
views
webui
app_launcher_handler.hbookmarks_ui.ccbug_report_ui.ccchrome_url_data_manager.ccchrome_url_data_manager.hchrome_url_data_manager_backend.ccchrome_url_data_manager_backend.h
chromeos
collected_cookies_ui_delegate.hcookies_tree_model_adapter.cccrashes_ui.ccdownloads_dom_handler.ccdownloads_dom_handler.hdownloads_ui.ccextension_icon_source.ccfavicon_source.hfilebrowse_ui.ccfileicon_source.ccflags_ui.ccforeign_session_handler.ccgpu_internals_ui.cchistory2_ui.cchistory_ui.cchtml_dialog_tab_contents_delegate_unittest.cckeyboard_ui.ccmediaplayer_browsertest.ccmediaplayer_ui.ccmost_visited_handler.ccnet_internals_ui.ccnew_tab_ui.ccntp_resource_cache.ccntp_resource_cache.h
options
plugins_ui.ccprint_preview_handler.hprint_preview_ui.hremoting_ui.ccscreenshot_source.ccshared_resources_data_source.ccshown_sections_handler_unittest.ccslideshow_ui.ccsync_internals_html_source.ccsync_internals_ui.cctextfields_ui.cctheme_source.cctheme_source_unittest.ccthumbnail_source.h
window_snapshot
upgrade_detector.ccuser_style_sheet_watcher.huser_style_sheet_watcher_unittest.ccutility_process_host.h
visitedlink
webdata
common
default_plugin
installer
nacl
profile_import
renderer
service
test
third_party
mozilla_security_manager
tools
utility
chrome_frame
content
browser
appcache
browser_thread_unittest.ccbrowsing_instance.hcancelable_request.hcert_store.hcertificate_manager_model.hchild_process_launcher.ccchild_process_launcher.hchild_process_security_policy.hchrome_blob_storage_context.hcross_site_request_manager.cc
device_orientation
file_system
geolocation
gpu_blacklist.hgpu_blacklist_unittest.ccgpu_process_host.cchost_zoom_map.hhost_zoom_map_unittest.cc
in_process_webkit
plugin_process_host.hplugin_service.h
renderer_host
speech
tab_contents
trace_controller.h
worker_host
zygote_host_linux.cczygote_main_linux.cc
common
gpu
plugin
ppapi_plugin
renderer
worker
courgette
gpu
ipc
jingle/notifier
media
net
base
disk_cache
ftp
http
proxy
server
socket
socket_stream
spdy
test
third_party
mozilla_security_manager
tools
udp
url_request
websockets
o3d
ppapi
printing
remoting
base
client
host
jingle_glue
protocol
sandbox
skia/ext
testing
third_party
cacheinvalidation
overrides
google
cacheinvalidation
cld
libjingle
overrides
talk
protobuf
src
google
protobuf
tools/imagediff
ui
views
webkit
appcache
blob
chromeos
database
fileapi
glue
gpu
plugins
quota
support
tools

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,7 +6,7 @@
#include "build/build_config.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/angle/include/EGL/egl.h"
// This header must come after the above third-party include, as

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,7 +7,7 @@
#pragma once
#include "app/gfx/gl/gl_context.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "ui/gfx/size.h"
typedef void* EGLDisplay;

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,7 +19,7 @@ extern "C" {
#include "app/gfx/gl/gl_implementation.h"
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "ui/base/x/x11_util.h"
namespace {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,7 +15,7 @@
#include "app/gfx/gl/gl_implementation.h"
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace gfx {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,8 +6,8 @@
#define APP_GFX_GL_GL_CONTEXT_OSMESA_H_
#pragma once
#include "base/scoped_ptr.h"
#include "app/gfx/gl/gl_context.h"
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/size.h"
typedef struct osmesa_context *OSMesaContext;

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,7 +17,7 @@
#include "app/gfx/gl/gl_implementation.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace gfx {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -11,7 +11,7 @@
#include <string>
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
class FilePath;

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -11,7 +11,7 @@
#include "app/sql/connection.h"
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "base/string16.h"
namespace sql {

@ -1,9 +1,9 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a low level implementation of atomic semantics for reference
// counting. Please use base/ref_counted.h directly instead.
// counting. Please use base/memory/ref_counted.h directly instead.
//
// The implementation includes annotations to avoid some false positives
// when using data race detection tools.

@ -99,9 +99,15 @@
'json/string_escape_unittest.cc',
'lazy_instance_unittest.cc',
'linked_list_unittest.cc',
'linked_ptr_unittest.cc',
'logging_unittest.cc',
'mac/mac_util_unittest.mm',
'memory/linked_ptr_unittest.cc',
'memory/ref_counted_unittest.cc',
'memory/scoped_native_library_unittest.cc',
'memory/scoped_ptr_unittest.cc',
'memory/scoped_temp_dir_unittest.cc',
'memory/singleton_unittest.cc',
'memory/weak_ptr_unittest.cc',
'message_loop_proxy_impl_unittest.cc',
'message_loop_unittest.cc',
'message_pump_glib_unittest.cc',
@ -117,14 +123,9 @@
'process_util_unittest_mac.h',
'process_util_unittest_mac.mm',
'rand_util_unittest.cc',
'ref_counted_unittest.cc',
'scoped_native_library_unittest.cc',
'scoped_ptr_unittest.cc',
'scoped_temp_dir_unittest.cc',
'sha1_unittest.cc',
'sha2_unittest.cc',
'shared_memory_unittest.cc',
'singleton_unittest.cc',
'stack_container_unittest.cc',
'string16_unittest.cc',
'string_number_conversions_unittest.cc',
@ -167,7 +168,6 @@
'values_unittest.cc',
'version_unittest.cc',
'vlog_unittest.cc',
'weak_ptr_unittest.cc',
'win/event_trace_consumer_unittest.cc',
'win/event_trace_controller_unittest.cc',
'win/event_trace_provider_unittest.cc',

@ -107,7 +107,6 @@
'lazy_instance.cc',
'lazy_instance.h',
'linked_list.h',
'linked_ptr.h',
'logging.cc',
'logging.h',
'logging_win.cc',
@ -124,8 +123,27 @@
'mac/scoped_nsautorelease_pool.mm',
'mach_ipc_mac.h',
'mach_ipc_mac.mm',
'memory_debug.cc',
'memory_debug.h',
'memory/linked_ptr.h',
'memory/memory_debug.cc',
'memory/memory_debug.h',
'memory/raw_scoped_refptr_mismatch_checker.h',
'memory/ref_counted.cc',
'memory/ref_counted.h',
'memory/ref_counted_memory.cc',
'memory/ref_counted_memory.h',
'memory/scoped_callback_factory.h',
'memory/scoped_handle.h',
'memory/scoped_native_library.cc',
'memory/scoped_native_library.h',
'memory/scoped_nsobject.h',
'memory/scoped_open_process.h',
'memory/scoped_ptr.h',
'memory/scoped_temp_dir.cc',
'memory/scoped_temp_dir.h',
'memory/scoped_vector.h',
'memory/singleton.h',
'memory/weak_ptr.cc',
'memory/weak_ptr.h',
'message_loop.cc',
'message_loop.h',
'message_loop_proxy.cc',
@ -177,32 +195,18 @@
'rand_util.h',
'rand_util_posix.cc',
'rand_util_win.cc',
'raw_scoped_refptr_mismatch_checker.h',
'ref_counted.cc',
'ref_counted.h',
'ref_counted_memory.cc',
'ref_counted_memory.h',
'resource_util.cc',
'resource_util.h',
'safe_strerror_posix.cc',
'safe_strerror_posix.h',
'scoped_callback_factory.h',
'scoped_handle.h',
'scoped_native_library.cc',
'scoped_native_library.h',
'scoped_nsobject.h',
'scoped_open_process.h',
'scoped_ptr.h',
'scoped_temp_dir.cc',
'scoped_temp_dir.h',
'scoped_vector.h',
'sha1.h',
'sha1_portable.cc',
'sha1_win.cc',
'shared_memory.h',
'shared_memory_posix.cc',
'shared_memory_win.cc',
'singleton.h',
'spin_wait.h',
'stack_container.h',
'stl_util-inl.h',
@ -306,8 +310,6 @@
'version.h',
'vlog.cc',
'vlog.h',
'weak_ptr.cc',
'weak_ptr.h',
'win/i18n.cc',
'win/i18n.h',
'win/object_watcher.cc',

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -14,8 +14,8 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/sys_string_conversions.h"
#include "base/nix/xdg_util.h"

@ -10,7 +10,7 @@
#pragma once
#include "base/base_api.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
namespace base {
namespace internal {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,8 +6,8 @@
#define BASE_CALLBACK_OLD_H_
#pragma once
#include "base/memory/raw_scoped_refptr_mismatch_checker.h"
#include "base/tuple.h"
#include "base/raw_scoped_refptr_mismatch_checker.h"
// Callback --------------------------------------------------------------------
//

@ -1,10 +1,10 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/callback.h"
#include "base/callback_internal.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -9,7 +9,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"

@ -1,11 +1,11 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/crypto/capi_util.h"
#include "base/basictypes.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
namespace {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -8,7 +8,7 @@
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include "base/sys_string_conversions.h"
// When writing crypto code for Mac OS X, you may find the following

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,7 +7,7 @@
#include <string>
#include "base/crypto/symmetric_key.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -4,7 +4,7 @@
#include "base/crypto/mac_security_services_lock.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
namespace {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -8,7 +8,7 @@
#include <list>
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_util.h"
// This file manually encodes and decodes RSA private keys using PrivateKeyInfo

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -8,7 +8,7 @@
#include "base/crypto/cssm_init.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -12,9 +12,9 @@
#include "base/debug/leak_annotations.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/nss_util.h"
#include "base/nss_util_internal.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
// TODO(rafaelw): Consider refactoring common functions and definitions from

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,8 +7,8 @@
#include <keyhi.h>
#include <pk11pub.h>
#include "base/memory/scoped_ptr.h"
#include "base/nss_util.h"
#include "base/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -9,8 +9,8 @@
#include <openssl/rsa.h>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/openssl_util.h"
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
namespace base {

@ -1,9 +1,9 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/crypto/rsa_private_key.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
// Generate random private keys with two different sizes. Reimport, then

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,7 +7,7 @@
#include <list>
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_util.h"
namespace {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -9,7 +9,7 @@
#include <nss.h>
#include <pk11pub.h>
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace base {

@ -5,7 +5,7 @@
#include "base/crypto/secure_hash.h"
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/sha2.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -8,7 +8,7 @@
#include "base/crypto/cssm_init.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -9,8 +9,8 @@
#include <stdlib.h>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/nss_util.h"
#include "base/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,8 +7,8 @@
#include <openssl/evp.h>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/openssl_util.h"
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,7 +6,7 @@
#include "base/crypto/signature_creator.h"
#include "base/crypto/signature_verifier.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
TEST(SignatureCreatorTest, BasicTest) {

@ -1,11 +1,11 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/crypto/signature_creator.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,8 +10,8 @@
#include <vector>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/openssl_util.h"
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,8 +10,8 @@
#include <algorithm>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/openssl_util.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,7 +6,7 @@
#include <string>
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -9,7 +9,7 @@
#include <vector>
// TODO(wtc): replace scoped_array by std::vector.
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -33,8 +33,8 @@
#include "base/basictypes.h"
#include "base/eintr_wrapper.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/safe_strerror_posix.h"
#include "base/scoped_ptr.h"
#include "base/string_piece.h"
#include "base/stringprintf.h"

@ -1,9 +1,9 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/debug/leak_tracker.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -30,8 +30,8 @@
#include "base/basictypes.h"
#include "base/eintr_wrapper.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/safe_strerror_posix.h"
#include "base/scoped_ptr.h"
#include "base/string_piece.h"
#include "base/stringprintf.h"

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -31,8 +31,8 @@
#include <string>
#include "base/scoped_ptr.h"
#include "base/singleton.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/synchronization/lock.h"
#include "base/time.h"
#include "base/timer.h"

@ -1,11 +1,11 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/debug/trace_event_win.h"
#include "base/logging.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include <initguid.h> // NOLINT
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -13,7 +13,7 @@
#include "base/string_util.h"
#if defined(OS_WIN)
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#endif

@ -1,9 +1,9 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/environment.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"

@ -29,8 +29,8 @@
#include "base/base_api.h"
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/platform_file.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
#if defined(OS_POSIX)

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -34,8 +34,8 @@
#include "base/eintr_wrapper.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/singleton.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "base/threading/thread_restrictions.h"

@ -10,8 +10,8 @@
#include "base/callback.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/platform_file.h"
#include "base/ref_counted.h"
#include "base/tracked_objects.h"
namespace base {

@ -18,8 +18,8 @@
#include "base/base_paths.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/memory/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
#include "base/threading/platform_thread.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -9,7 +9,7 @@
#include <string>
#include "base/file_version_info.h"
#include "base/scoped_nsobject.h"
#include "base/memory/scoped_nsobject.h"
#ifdef __OBJC__
@class NSBundle;

@ -1,10 +1,10 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/file_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/file_version_info.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -11,7 +11,7 @@
#include "base/base_api.h"
#include "base/basictypes.h"
#include "base/file_version_info.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
struct tagVS_FIXEDFILEINFO;
typedef tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO;

@ -13,7 +13,7 @@
#include <stdint.h>
#include "base/singleton.h"
#include "base/memory/singleton.h"
namespace base {

@ -13,7 +13,7 @@
#include "base/base_api.h"
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -9,8 +9,8 @@
#include "base/crypto/scoped_nss_types.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/nss_util.h"
#include "base/scoped_ptr.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,8 +10,8 @@
#include <vector>
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/openssl_util.h"
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
namespace base {

@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -8,8 +8,8 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/singleton.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/sys_string_conversions.h"

@ -1,4 +1,4 @@
// Copyright (c) 2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -7,7 +7,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/lazy_instance.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "unicode/numfmt.h"

@ -1,11 +1,11 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/i18n/time_formatting.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#include "base/time.h"
#include "unicode/datefmt.h"

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,7 +6,7 @@
#include "base/float_util.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"

@ -1,10 +1,10 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "testing/gtest/include/gtest/gtest.h"
#include "base/json/json_reader.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_piece.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium 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,10 +17,10 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/singleton.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/synchronization/lock.h"

@ -1,9 +1,9 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/logging_win.h"
#include "base/singleton.h"
#include "base/memory/singleton.h"
#include <initguid.h> // NOLINT
namespace logging {

@ -9,7 +9,7 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/scoped_nsobject.h"
#include "base/memory/scoped_nsobject.h"
#include "base/sys_string_conversions.h"
namespace base {

@ -9,7 +9,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/scoped_nsobject.h"
#include "base/memory/scoped_nsobject.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"

@ -1,4 +1,4 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@ -34,8 +34,8 @@
// - is thread safe for copying and deletion
// - supports weak_ptrs
#ifndef BASE_LINKED_PTR_H_
#define BASE_LINKED_PTR_H_
#ifndef BASE_MEMORY_LINKED_PTR_H_
#define BASE_MEMORY_LINKED_PTR_H_
#pragma once
#include "base/logging.h" // for CHECK macros
@ -179,4 +179,4 @@ linked_ptr<T> make_linked_ptr(T* ptr) {
return linked_ptr<T>(ptr);
}
#endif // BASE_LINKED_PTR_H_
#endif // BASE_MEMORY_LINKED_PTR_H_

@ -1,10 +1,10 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "base/linked_ptr.h"
#include "base/memory/linked_ptr.h"
#include "base/stringprintf.h"
#include "testing/gtest/include/gtest/gtest.h"

@ -1,8 +1,8 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/memory_debug.h"
#include "base/memory/memory_debug.h"
#ifdef PURIFY
// this #define is used to prevent people from directly using pure.h

@ -1,4 +1,4 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -6,8 +6,8 @@
// All methods are effectively no-ops unless this program is being run through
// a supported memory tool (currently, only Purify)
#ifndef BASE_MEMORY_DEBUG_H_
#define BASE_MEMORY_DEBUG_H_
#ifndef BASE_MEMORY_MEMORY_DEBUG_H_
#define BASE_MEMORY_MEMORY_DEBUG_H_
#pragma once
#include "base/basictypes.h"
@ -44,4 +44,4 @@ class MemoryDebug {
} // namespace base
#endif // BASE_MEMORY_DEBUG_H_
#endif // BASE_MEMORY_MEMORY_DEBUG_H_

@ -1,12 +1,12 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#define BASE_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#ifndef BASE_MEMORY_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#define BASE_MEMORY_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#pragma once
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "base/template_util.h"
#include "base/tuple.h"
#include "build/build_config.h"
@ -127,4 +127,4 @@ struct ParamsUseScopedRefptrCorrectly<Tuple8<A, B, C, D, E, F, G, H> > {
} // namespace base
#endif // BASE_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_
#endif // BASE_MEMORY_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_

@ -1,8 +1,8 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "base/logging.h"
#include "base/threading/thread_collision_warner.h"

299
base/memory/ref_counted.h Normal file

@ -0,0 +1,299 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_MEMORY_REF_COUNTED_H_
#define BASE_MEMORY_REF_COUNTED_H_
#pragma once
#include "base/atomic_ref_count.h"
#include "base/base_api.h"
#include "base/threading/thread_collision_warner.h"
namespace base {
namespace subtle {
class BASE_API RefCountedBase {
public:
static bool ImplementsThreadSafeReferenceCounting() { return false; }
bool HasOneRef() const { return ref_count_ == 1; }
protected:
RefCountedBase();
~RefCountedBase();
void AddRef() const;
// Returns true if the object should self-delete.
bool Release() const;
private:
mutable int ref_count_;
#ifndef NDEBUG
mutable bool in_dtor_;
#endif
DFAKE_MUTEX(add_release_);
DISALLOW_COPY_AND_ASSIGN(RefCountedBase);
};
class BASE_API RefCountedThreadSafeBase {
public:
static bool ImplementsThreadSafeReferenceCounting() { return true; }
bool HasOneRef() const;
protected:
RefCountedThreadSafeBase();
~RefCountedThreadSafeBase();
void AddRef() const;
// Returns true if the object should self-delete.
bool Release() const;
private:
mutable AtomicRefCount ref_count_;
#ifndef NDEBUG
mutable bool in_dtor_;
#endif
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase);
};
} // namespace subtle
//
// A base class for reference counted classes. Otherwise, known as a cheap
// knock-off of WebKit's RefCounted<T> class. To use this guy just extend your
// class from it like so:
//
// class MyFoo : public base::RefCounted<MyFoo> {
// ...
// private:
// friend class base::RefCounted<MyFoo>;
// ~MyFoo();
// };
//
// You should always make your destructor private, to avoid any code deleting
// the object accidently while there are references to it.
template <class T>
class RefCounted : public subtle::RefCountedBase {
public:
RefCounted() { }
~RefCounted() { }
void AddRef() const {
subtle::RefCountedBase::AddRef();
}
void Release() const {
if (subtle::RefCountedBase::Release()) {
delete static_cast<const T*>(this);
}
}
private:
DISALLOW_COPY_AND_ASSIGN(RefCounted<T>);
};
// Forward declaration.
template <class T, typename Traits> class RefCountedThreadSafe;
// Default traits for RefCountedThreadSafe<T>. Deletes the object when its ref
// count reaches 0. Overload to delete it on a different thread etc.
template<typename T>
struct DefaultRefCountedThreadSafeTraits {
static void Destruct(const T* x) {
// Delete through RefCountedThreadSafe to make child classes only need to be
// friend with RefCountedThreadSafe instead of this struct, which is an
// implementation detail.
RefCountedThreadSafe<T,
DefaultRefCountedThreadSafeTraits>::DeleteInternal(x);
}
};
//
// A thread-safe variant of RefCounted<T>
//
// class MyFoo : public base::RefCountedThreadSafe<MyFoo> {
// ...
// };
//
// If you're using the default trait, then you should add compile time
// asserts that no one else is deleting your object. i.e.
// private:
// friend class base::RefCountedThreadSafe<MyFoo>;
// ~MyFoo();
template <class T, typename Traits = DefaultRefCountedThreadSafeTraits<T> >
class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase {
public:
RefCountedThreadSafe() { }
~RefCountedThreadSafe() { }
void AddRef() const {
subtle::RefCountedThreadSafeBase::AddRef();
}
void Release() const {
if (subtle::RefCountedThreadSafeBase::Release()) {
Traits::Destruct(static_cast<const T*>(this));
}
}
private:
friend struct DefaultRefCountedThreadSafeTraits<T>;
static void DeleteInternal(const T* x) { delete x; }
DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe);
};
//
// A wrapper for some piece of data so we can place other things in
// scoped_refptrs<>.
//
template<typename T>
class RefCountedData : public base::RefCounted< base::RefCountedData<T> > {
public:
RefCountedData() : data() {}
RefCountedData(const T& in_value) : data(in_value) {}
T data;
};
} // namespace base
//
// A smart pointer class for reference counted objects. Use this class instead
// of calling AddRef and Release manually on a reference counted object to
// avoid common memory leaks caused by forgetting to Release an object
// reference. Sample usage:
//
// class MyFoo : public RefCounted<MyFoo> {
// ...
// };
//
// void some_function() {
// scoped_refptr<MyFoo> foo = new MyFoo();
// foo->Method(param);
// // |foo| is released when this function returns
// }
//
// void some_other_function() {
// scoped_refptr<MyFoo> foo = new MyFoo();
// ...
// foo = NULL; // explicitly releases |foo|
// ...
// if (foo)
// foo->Method(param);
// }
//
// The above examples show how scoped_refptr<T> acts like a pointer to T.
// Given two scoped_refptr<T> classes, it is also possible to exchange
// references between the two objects, like so:
//
// {
// scoped_refptr<MyFoo> a = new MyFoo();
// scoped_refptr<MyFoo> b;
//
// b.swap(a);
// // now, |b| references the MyFoo object, and |a| references NULL.
// }
//
// To make both |a| and |b| in the above example reference the same MyFoo
// object, simply use the assignment operator:
//
// {
// scoped_refptr<MyFoo> a = new MyFoo();
// scoped_refptr<MyFoo> b;
//
// b = a;
// // now, |a| and |b| each own a reference to the same MyFoo object.
// }
//
template <class T>
class scoped_refptr {
public:
scoped_refptr() : ptr_(NULL) {
}
scoped_refptr(T* p) : ptr_(p) {
if (ptr_)
ptr_->AddRef();
}
scoped_refptr(const scoped_refptr<T>& r) : ptr_(r.ptr_) {
if (ptr_)
ptr_->AddRef();
}
template <typename U>
scoped_refptr(const scoped_refptr<U>& r) : ptr_(r.get()) {
if (ptr_)
ptr_->AddRef();
}
~scoped_refptr() {
if (ptr_)
ptr_->Release();
}
T* get() const { return ptr_; }
operator T*() const { return ptr_; }
T* operator->() const { return ptr_; }
// Release a pointer.
// The return value is the current pointer held by this object.
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
T* release() {
T* retVal = ptr_;
ptr_ = NULL;
return retVal;
}
scoped_refptr<T>& operator=(T* p) {
// AddRef first so that self assignment should work
if (p)
p->AddRef();
if (ptr_ )
ptr_ ->Release();
ptr_ = p;
return *this;
}
scoped_refptr<T>& operator=(const scoped_refptr<T>& r) {
return *this = r.ptr_;
}
template <typename U>
scoped_refptr<T>& operator=(const scoped_refptr<U>& r) {
return *this = r.get();
}
void swap(T** pp) {
T* p = ptr_;
ptr_ = *pp;
*pp = p;
}
void swap(scoped_refptr<T>& r) {
swap(&r.ptr_);
}
protected:
T* ptr_;
};
// Handy utility for creating a scoped_refptr<T> out of a T* explicitly without
// having to retype all the template arguments
template <typename T>
scoped_refptr<T> make_scoped_refptr(T* t) {
return scoped_refptr<T>(t);
}
#endif // BASE_MEMORY_REF_COUNTED_H_

@ -1,8 +1,8 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/ref_counted_memory.h"
#include "base/memory/ref_counted_memory.h"
RefCountedMemory::RefCountedMemory() {
}

@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_REF_COUNTED_MEMORY_H_
#define BASE_REF_COUNTED_MEMORY_H_
#ifndef BASE_MEMORY_REF_COUNTED_MEMORY_H_
#define BASE_MEMORY_REF_COUNTED_MEMORY_H_
#pragma once
#include <vector>
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
// TODO(erg): The contents of this file should be in a namespace. This would
// require touching >100 files in chrome/ though.
@ -79,4 +79,4 @@ class RefCountedBytes : public RefCountedMemory {
DISALLOW_COPY_AND_ASSIGN(RefCountedBytes);
};
#endif // BASE_REF_COUNTED_MEMORY_H_
#endif // BASE_MEMORY_REF_COUNTED_MEMORY_H_

@ -1,9 +1,9 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/memory/ref_counted.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "base/ref_counted.h"
namespace {

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -33,11 +33,11 @@
// callback runs, it will notice that the MyClass instance is dead, and it will
// avoid calling the GotData method.
#ifndef BASE_SCOPED_CALLBACK_FACTORY_H_
#define BASE_SCOPED_CALLBACK_FACTORY_H_
#ifndef BASE_MEMORY_SCOPED_CALLBACK_FACTORY_H_
#define BASE_MEMORY_SCOPED_CALLBACK_FACTORY_H_
#include "base/callback.h"
#include "base/weak_ptr.h"
#include "base/memory/weak_ptr.h"
namespace base {
@ -130,4 +130,4 @@ class ScopedCallbackFactory {
} // namespace base
#endif // BASE_SCOPED_CALLBACK_FACTORY_H_
#endif // BASE_MEMORY_SCOPED_CALLBACK_FACTORY_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 BASE_SCOPED_HANDLE_H_
#define BASE_SCOPED_HANDLE_H_
#ifndef BASE_MEMORY_SCOPED_HANDLE_H_
#define BASE_MEMORY_SCOPED_HANDLE_H_
#pragma once
#include <stdio.h>
@ -48,4 +48,4 @@ class ScopedStdioHandle {
DISALLOW_COPY_AND_ASSIGN(ScopedStdioHandle);
};
#endif // BASE_SCOPED_HANDLE_H_
#endif // BASE_MEMORY_SCOPED_HANDLE_H_

@ -1,8 +1,8 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/scoped_native_library.h"
#include "base/memory/scoped_native_library.h"
namespace base {

@ -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 BASE_SCOPED_NATIVE_LIBRARY_H_
#define BASE_SCOPED_NATIVE_LIBRARY_H_
#ifndef BASE_MEMORY_SCOPED_NATIVE_LIBRARY_H_
#define BASE_MEMORY_SCOPED_NATIVE_LIBRARY_H_
#pragma once
#include "base/base_api.h"
@ -50,4 +50,4 @@ class BASE_API ScopedNativeLibrary {
} // namespace base
#endif // BASE_SCOPED_NATIVE_LIBRARY_H_
#endif // BASE_MEMORY_SCOPED_NATIVE_LIBRARY_H_

@ -1,8 +1,8 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/scoped_native_library.h"
#include "base/memory/scoped_native_library.h"
#if defined(OS_WIN)
#include "base/file_path.h"
#endif

@ -1,9 +1,9 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_SCOPED_NSOBJECT_H_
#define BASE_SCOPED_NSOBJECT_H_
#ifndef BASE_MEMORY_SCOPED_NSOBJECT_H_
#define BASE_MEMORY_SCOPED_NSOBJECT_H_
#pragma once
#import <Foundation/Foundation.h>
@ -164,4 +164,4 @@ class scoped_nsobject<NSAutoreleasePool> {
DISALLOW_COPY_AND_ASSIGN(scoped_nsobject);
};
#endif // BASE_SCOPED_NSOBJECT_H_
#endif // BASE_MEMORY_SCOPED_NSOBJECT_H_

@ -1,9 +1,9 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_SCOPED_OPEN_PROCESS_H_
#define BASE_SCOPED_OPEN_PROCESS_H_
#ifndef BASE_MEMORY_SCOPED_OPEN_PROCESS_H_
#define BASE_MEMORY_SCOPED_OPEN_PROCESS_H_
#pragma once
#include "base/process.h"
@ -47,4 +47,4 @@ class ScopedOpenProcess {
};
} // namespace base
#endif // BASE_SCOPED_OPEN_PROCESS_H_
#endif // BASE_MEMORY_SCOPED_OPEN_PROCESS_H_

383
base/memory/scoped_ptr.h Normal file

@ -0,0 +1,383 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Scopers help you manage ownership of a pointer, helping you easily manage the
// a pointer within a scope, and automatically destroying the pointer at the
// end of a scope. There are two main classes you will use, which correspond
// to the operators new/delete and new[]/delete[].
//
// Example usage (scoped_ptr):
// {
// scoped_ptr<Foo> foo(new Foo("wee"));
// } // foo goes out of scope, releasing the pointer with it.
//
// {
// scoped_ptr<Foo> foo; // No pointer managed.
// foo.reset(new Foo("wee")); // Now a pointer is managed.
// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed.
// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed.
// foo->Method(); // Foo::Method() called.
// foo.get()->Method(); // Foo::Method() called.
// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer
// // manages a pointer.
// foo.reset(new Foo("wee4")); // foo manages a pointer again.
// foo.reset(); // Foo("wee4") destroyed, foo no longer
// // manages a pointer.
// } // foo wasn't managing a pointer, so nothing was destroyed.
//
// Example usage (scoped_array):
// {
// scoped_array<Foo> foo(new Foo[100]);
// foo.get()->Method(); // Foo::Method on the 0th element.
// foo[10].Method(); // Foo::Method on the 10th element.
// }
#ifndef BASE_MEMORY_SCOPED_PTR_H_
#define BASE_MEMORY_SCOPED_PTR_H_
#pragma once
// This is an implementation designed to match the anticipated future TR2
// implementation of the scoped_ptr class, and its closely-related brethren,
// scoped_array, scoped_ptr_malloc.
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include "base/compiler_specific.h"
// A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T>
// automatically deletes the pointer it holds (if any).
// That is, scoped_ptr<T> owns the T object that it points to.
// Like a T*, a scoped_ptr<T> may hold either NULL or a pointer to a T object.
// Also like T*, scoped_ptr<T> is thread-compatible, and once you
// dereference it, you get the threadsafety guarantees of T.
//
// The size of a scoped_ptr is small:
// sizeof(scoped_ptr<C>) == sizeof(C*)
template <class C>
class scoped_ptr {
public:
// The element type
typedef C element_type;
// Constructor. Defaults to initializing with NULL.
// There is no way to create an uninitialized scoped_ptr.
// The input parameter must be allocated with new.
explicit scoped_ptr(C* p = NULL) : ptr_(p) { }
// Destructor. If there is a C object, delete it.
// We don't need to test ptr_ == NULL because C++ does that for us.
~scoped_ptr() {
enum { type_must_be_complete = sizeof(C) };
delete ptr_;
}
// Reset. Deletes the current owned object, if any.
// Then takes ownership of a new object, if given.
// this->reset(this->get()) works.
void reset(C* p = NULL) {
if (p != ptr_) {
enum { type_must_be_complete = sizeof(C) };
delete ptr_;
ptr_ = p;
}
}
// Accessors to get the owned object.
// operator* and operator-> will assert() if there is no current object.
C& operator*() const {
assert(ptr_ != NULL);
return *ptr_;
}
C* operator->() const {
assert(ptr_ != NULL);
return ptr_;
}
C* get() const { return ptr_; }
// Comparison operators.
// These return whether two scoped_ptr refer to the same object, not just to
// two different but equal objects.
bool operator==(C* p) const { return ptr_ == p; }
bool operator!=(C* p) const { return ptr_ != p; }
// Swap two scoped pointers.
void swap(scoped_ptr& p2) {
C* tmp = ptr_;
ptr_ = p2.ptr_;
p2.ptr_ = tmp;
}
// Release a pointer.
// The return value is the current pointer held by this object.
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
C* release() WARN_UNUSED_RESULT {
C* retVal = ptr_;
ptr_ = NULL;
return retVal;
}
private:
C* ptr_;
// Forbid comparison of scoped_ptr types. If C2 != C, it totally doesn't
// make sense, and if C2 == C, it still doesn't make sense because you should
// never have the same object owned by two different scoped_ptrs.
template <class C2> bool operator==(scoped_ptr<C2> const& p2) const;
template <class C2> bool operator!=(scoped_ptr<C2> const& p2) const;
// Disallow evil constructors
scoped_ptr(const scoped_ptr&);
void operator=(const scoped_ptr&);
};
// Free functions
template <class C>
void swap(scoped_ptr<C>& p1, scoped_ptr<C>& p2) {
p1.swap(p2);
}
template <class C>
bool operator==(C* p1, const scoped_ptr<C>& p2) {
return p1 == p2.get();
}
template <class C>
bool operator!=(C* p1, const scoped_ptr<C>& p2) {
return p1 != p2.get();
}
// scoped_array<C> is like scoped_ptr<C>, except that the caller must allocate
// with new [] and the destructor deletes objects with delete [].
//
// As with scoped_ptr<C>, a scoped_array<C> either points to an object
// or is NULL. A scoped_array<C> owns the object that it points to.
// scoped_array<T> is thread-compatible, and once you index into it,
// the returned objects have only the threadsafety guarantees of T.
//
// Size: sizeof(scoped_array<C>) == sizeof(C*)
template <class C>
class scoped_array {
public:
// The element type
typedef C element_type;
// Constructor. Defaults to intializing with NULL.
// There is no way to create an uninitialized scoped_array.
// The input parameter must be allocated with new [].
explicit scoped_array(C* p = NULL) : array_(p) { }
// Destructor. If there is a C object, delete it.
// We don't need to test ptr_ == NULL because C++ does that for us.
~scoped_array() {
enum { type_must_be_complete = sizeof(C) };
delete[] array_;
}
// Reset. Deletes the current owned object, if any.
// Then takes ownership of a new object, if given.
// this->reset(this->get()) works.
void reset(C* p = NULL) {
if (p != array_) {
enum { type_must_be_complete = sizeof(C) };
delete[] array_;
array_ = p;
}
}
// Get one element of the current object.
// Will assert() if there is no current object, or index i is negative.
C& operator[](ptrdiff_t i) const {
assert(i >= 0);
assert(array_ != NULL);
return array_[i];
}
// Get a pointer to the zeroth element of the current object.
// If there is no current object, return NULL.
C* get() const {
return array_;
}
// Comparison operators.
// These return whether two scoped_array refer to the same object, not just to
// two different but equal objects.
bool operator==(C* p) const { return array_ == p; }
bool operator!=(C* p) const { return array_ != p; }
// Swap two scoped arrays.
void swap(scoped_array& p2) {
C* tmp = array_;
array_ = p2.array_;
p2.array_ = tmp;
}
// Release an array.
// The return value is the current pointer held by this object.
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
C* release() WARN_UNUSED_RESULT {
C* retVal = array_;
array_ = NULL;
return retVal;
}
private:
C* array_;
// Forbid comparison of different scoped_array types.
template <class C2> bool operator==(scoped_array<C2> const& p2) const;
template <class C2> bool operator!=(scoped_array<C2> const& p2) const;
// Disallow evil constructors
scoped_array(const scoped_array&);
void operator=(const scoped_array&);
};
// Free functions
template <class C>
void swap(scoped_array<C>& p1, scoped_array<C>& p2) {
p1.swap(p2);
}
template <class C>
bool operator==(C* p1, const scoped_array<C>& p2) {
return p1 == p2.get();
}
template <class C>
bool operator!=(C* p1, const scoped_array<C>& p2) {
return p1 != p2.get();
}
// This class wraps the c library function free() in a class that can be
// passed as a template argument to scoped_ptr_malloc below.
class ScopedPtrMallocFree {
public:
inline void operator()(void* x) const {
free(x);
}
};
// scoped_ptr_malloc<> is similar to scoped_ptr<>, but it accepts a
// second template argument, the functor used to free the object.
template<class C, class FreeProc = ScopedPtrMallocFree>
class scoped_ptr_malloc {
public:
// The element type
typedef C element_type;
// Constructor. Defaults to initializing with NULL.
// There is no way to create an uninitialized scoped_ptr.
// The input parameter must be allocated with an allocator that matches the
// Free functor. For the default Free functor, this is malloc, calloc, or
// realloc.
explicit scoped_ptr_malloc(C* p = NULL): ptr_(p) {}
// Destructor. If there is a C object, call the Free functor.
~scoped_ptr_malloc() {
free_(ptr_);
}
// Reset. Calls the Free functor on the current owned object, if any.
// Then takes ownership of a new object, if given.
// this->reset(this->get()) works.
void reset(C* p = NULL) {
if (ptr_ != p) {
free_(ptr_);
ptr_ = p;
}
}
// Get the current object.
// operator* and operator-> will cause an assert() failure if there is
// no current object.
C& operator*() const {
assert(ptr_ != NULL);
return *ptr_;
}
C* operator->() const {
assert(ptr_ != NULL);
return ptr_;
}
C* get() const {
return ptr_;
}
// Comparison operators.
// These return whether a scoped_ptr_malloc and a plain pointer refer
// to the same object, not just to two different but equal objects.
// For compatibility with the boost-derived implementation, these
// take non-const arguments.
bool operator==(C* p) const {
return ptr_ == p;
}
bool operator!=(C* p) const {
return ptr_ != p;
}
// Swap two scoped pointers.
void swap(scoped_ptr_malloc & b) {
C* tmp = b.ptr_;
b.ptr_ = ptr_;
ptr_ = tmp;
}
// Release a pointer.
// The return value is the current pointer held by this object.
// If this object holds a NULL pointer, the return value is NULL.
// After this operation, this object will hold a NULL pointer,
// and will not own the object any more.
C* release() WARN_UNUSED_RESULT {
C* tmp = ptr_;
ptr_ = NULL;
return tmp;
}
private:
C* ptr_;
// no reason to use these: each scoped_ptr_malloc should have its own object
template <class C2, class GP>
bool operator==(scoped_ptr_malloc<C2, GP> const& p) const;
template <class C2, class GP>
bool operator!=(scoped_ptr_malloc<C2, GP> const& p) const;
static FreeProc const free_;
// Disallow evil constructors
scoped_ptr_malloc(const scoped_ptr_malloc&);
void operator=(const scoped_ptr_malloc&);
};
template<class C, class FP>
FP const scoped_ptr_malloc<C, FP>::free_ = FP();
template<class C, class FP> inline
void swap(scoped_ptr_malloc<C, FP>& a, scoped_ptr_malloc<C, FP>& b) {
a.swap(b);
}
template<class C, class FP> inline
bool operator==(C* p, const scoped_ptr_malloc<C, FP>& b) {
return p == b.get();
}
template<class C, class FP> inline
bool operator!=(C* p, const scoped_ptr_malloc<C, FP>& b) {
return p != b.get();
}
#endif // BASE_MEMORY_SCOPED_PTR_H_

@ -1,9 +1,9 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {

@ -1,8 +1,8 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/scoped_temp_dir.h"
#include "base/memory/scoped_temp_dir.h"
#include "base/file_util.h"
#include "base/logging.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 BASE_SCOPED_TEMP_DIR_H_
#define BASE_SCOPED_TEMP_DIR_H_
#ifndef BASE_MEMORY_SCOPED_TEMP_DIR_H_
#define BASE_MEMORY_SCOPED_TEMP_DIR_H_
#pragma once
// An object representing a temporary / scratch directory that should be cleaned
@ -56,4 +56,4 @@ class BASE_API ScopedTempDir {
DISALLOW_COPY_AND_ASSIGN(ScopedTempDir);
};
#endif // BASE_SCOPED_TEMP_DIR_H_
#endif // BASE_MEMORY_SCOPED_TEMP_DIR_H_

@ -1,10 +1,10 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/file_util.h"
#include "base/memory/scoped_temp_dir.h"
#include "base/platform_file.h"
#include "base/scoped_temp_dir.h"
#include "testing/gtest/include/gtest/gtest.h"
TEST(ScopedTempDir, FullPath) {

@ -1,9 +1,9 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_SCOPED_VECTOR_H_
#define BASE_SCOPED_VECTOR_H_
#ifndef BASE_MEMORY_SCOPED_VECTOR_H_
#define BASE_MEMORY_SCOPED_VECTOR_H_
#pragma once
#include <vector>
@ -87,4 +87,4 @@ class ScopedVector {
DISALLOW_COPY_AND_ASSIGN(ScopedVector);
};
#endif // BASE_SCOPED_VECTOR_H_
#endif // BASE_MEMORY_SCOPED_VECTOR_H_

@ -1,9 +1,9 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_SINGLETON_H_
#define BASE_SINGLETON_H_
#ifndef BASE_MEMORY_SINGLETON_H_
#define BASE_MEMORY_SINGLETON_H_
#pragma once
#include "base/at_exit.h"
@ -126,7 +126,7 @@ template <typename Type> base::subtle::Atomic32
// Example usage:
//
// In your header:
// #include "base/singleton.h"
// #include "base/memory/singleton.h"
// class FooClass {
// public:
// static FooClass* GetInstance(); <-- See comment below on this.
@ -268,4 +268,4 @@ template <typename Type, typename Traits, typename DifferentiatingType>
base::subtle::AtomicWord Singleton<Type, Traits, DifferentiatingType>::
instance_ = 0;
#endif // BASE_SINGLETON_H_
#endif // BASE_MEMORY_SINGLETON_H_

@ -1,4 +1,4 @@
// Copyright (c) 2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -27,12 +27,12 @@
// ...
// Foo* widgetSingleton = SingletonObjC<Foo, FooSingletonTraits>::get();
#ifndef BASE_SINGLETON_OBJC_H_
#define BASE_SINGLETON_OBJC_H_
#ifndef BASE_MEMORY_SINGLETON_OBJC_H_
#define BASE_MEMORY_SINGLETON_OBJC_H_
#pragma once
#import <Foundation/Foundation.h>
#include "base/singleton.h"
#include "base/memory/singleton.h"
// Singleton traits usable to manage traditional Objective-C objects, which
// are instantiated by sending |alloc| and |init| messages, and are deallocated
@ -58,4 +58,4 @@ template<typename Type,
class SingletonObjC : public Singleton<Type, Traits, DifferentiatingType> {
};
#endif // BASE_SINGLETON_OBJC_H_
#endif // BASE_MEMORY_SINGLETON_OBJC_H_

@ -1,11 +1,11 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/at_exit.h"
#include "base/file_util.h"
#include "base/memory/singleton.h"
#include "base/path_service.h"
#include "base/singleton.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {

@ -1,8 +1,8 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/weak_ptr.h"
#include "base/memory/weak_ptr.h"
namespace base {
namespace internal {

@ -48,13 +48,13 @@
// WARNING: weak pointers are not threadsafe!!! You must only use a WeakPtr
// instance on thread where it was created.
#ifndef BASE_WEAK_PTR_H_
#define BASE_WEAK_PTR_H_
#ifndef BASE_MEMORY_WEAK_PTR_H_
#define BASE_MEMORY_WEAK_PTR_H_
#pragma once
#include "base/base_api.h"
#include "base/logging.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
namespace base {
@ -243,4 +243,4 @@ class WeakPtrFactory {
} // namespace base
#endif // BASE_WEAK_PTR_H_
#endif // BASE_MEMORY_WEAK_PTR_H_

@ -1,12 +1,12 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "base/message_loop.h"
#include "base/threading/thread.h"
#include "base/scoped_ptr.h"
#include "base/weak_ptr.h"
namespace base {
namespace {

@ -11,9 +11,9 @@
#include "base/base_api.h"
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/message_pump.h"
#include "base/observer_list.h"
#include "base/ref_counted.h"
#include "base/synchronization/lock.h"
#include "base/task.h"

@ -8,7 +8,7 @@
#include "base/base_api.h"
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
#include "base/task.h"
namespace base {

@ -1,10 +1,10 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy_impl.h"
#include "base/scoped_ptr.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"

@ -6,8 +6,8 @@
#include "base/eintr_wrapper.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop.h"
#include "base/ref_counted.h"
#include "base/task.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread.h"

@ -7,7 +7,7 @@
#pragma once
#include "base/base_api.h"
#include "base/ref_counted.h"
#include "base/memory/ref_counted.h"
namespace base {

Some files were not shown because too many files have changed in this diff Show More