summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 20:32:22 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 20:32:22 +0000
commitb6413b49b4a1bf216bbc70cc330e905c42db5c5b (patch)
tree1ea76480a59217bd06dadcb071dad2d8150a6518
parenta6c642112b067d998e699e09302d8c48649b108f (diff)
downloadchromium_src-b6413b49b4a1bf216bbc70cc330e905c42db5c5b.zip
chromium_src-b6413b49b4a1bf216bbc70cc330e905c42db5c5b.tar.gz
chromium_src-b6413b49b4a1bf216bbc70cc330e905c42db5c5b.tar.bz2
shared_memory: remove wstrings, fix callers.
BUG=23581 TEST=compiles Review URL: http://codereview.chromium.org/3555002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60985 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--app/clipboard/clipboard_unittest.cc2
-rw-r--r--app/surface/transport_dib_mac.cc2
-rw-r--r--app/surface/transport_dib_win.cc2
-rw-r--r--base/shared_memory.h11
-rw-r--r--base/shared_memory_posix.cc23
-rw-r--r--base/shared_memory_unittest.cc16
-rw-r--r--base/shared_memory_win.cc15
-rw-r--r--base/stats_table.cc2
-rw-r--r--base/stats_table_unittest.cc4
-rw-r--r--chrome/browser/extensions/user_script_master.cc2
-rw-r--r--chrome/browser/renderer_host/async_resource_handler.cc2
-rw-r--r--chrome/browser/renderer_host/audio_renderer_host.cc2
-rw-r--r--chrome/browser/renderer_host/render_sandbox_host_linux.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_helper.cc2
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc2
-rw-r--r--chrome/browser/visitedlink_master.cc2
-rw-r--r--chrome/common/font_loader_mac.mm2
-rw-r--r--chrome/common/resource_dispatcher_unittest.cc6
-rw-r--r--chrome/common/sandbox_mac_fontloading_unittest.mm2
-rw-r--r--chrome/gpu/gpu_video_decoder.cc2
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc2
-rw-r--r--chrome/renderer/media/audio_renderer_impl_unittest.cc2
-rw-r--r--chrome/renderer/mock_render_thread.cc2
-rw-r--r--chrome/renderer/print_web_view_helper_win.cc2
-rw-r--r--chrome/renderer/renderer_glue.cc2
-rw-r--r--chrome/renderer/safe_browsing/render_view_fake_resources_test.cc3
-rw-r--r--chrome/test/unit/chrome_test_suite.cc2
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc4
-rw-r--r--gpu/command_buffer/service/gpu_processor_unittest.cc2
-rw-r--r--webkit/tools/test_shell/test_shell_main.cc2
30 files changed, 62 insertions, 64 deletions
diff --git a/app/clipboard/clipboard_unittest.cc b/app/clipboard/clipboard_unittest.cc
index abc3db5..0685fb7 100644
--- a/app/clipboard/clipboard_unittest.cc
+++ b/app/clipboard/clipboard_unittest.cc
@@ -255,7 +255,7 @@ TEST_F(ClipboardTest, SharedBitmapTest) {
// Create shared memory region.
base::SharedMemory shared_buf;
- ASSERT_TRUE(shared_buf.Create(L"", false, true, bytes));
+ ASSERT_TRUE(shared_buf.Create("", false, true, bytes));
ASSERT_TRUE(shared_buf.Map(bytes));
memcpy(shared_buf.memory(), fake_bitmap, bytes);
base::SharedMemoryHandle handle_to_share;
diff --git a/app/surface/transport_dib_mac.cc b/app/surface/transport_dib_mac.cc
index 97d18d7..a3eb0bb 100644
--- a/app/surface/transport_dib_mac.cc
+++ b/app/surface/transport_dib_mac.cc
@@ -28,7 +28,7 @@ TransportDIB::~TransportDIB() {
// static
TransportDIB* TransportDIB::Create(size_t size, uint32 sequence_num) {
TransportDIB* dib = new TransportDIB;
- if (!dib->shared_memory_.Create(L"", false /* read write */,
+ if (!dib->shared_memory_.Create("", false /* read write */,
false /* do not open existing */, size)) {
delete dib;
return NULL;
diff --git a/app/surface/transport_dib_win.cc b/app/surface/transport_dib_win.cc
index 9246f24..f7746e3 100644
--- a/app/surface/transport_dib_win.cc
+++ b/app/surface/transport_dib_win.cc
@@ -29,7 +29,7 @@ TransportDIB* TransportDIB::Create(size_t size, uint32 sequence_num) {
TransportDIB* dib = new TransportDIB;
- if (!dib->shared_memory_.Create(L"", false /* read write */,
+ if (!dib->shared_memory_.Create("", false /* read write */,
true /* open existing */, size)) {
delete dib;
return NULL;
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 1f7cc26..053026e 100644
--- a/base/shared_memory.h
+++ b/base/shared_memory.h
@@ -72,18 +72,18 @@ class SharedMemory {
// opens the existing shared memory and ignores the size parameter.
// If name is the empty string, use a unique name.
// Returns true on success, false on failure.
- bool Create(const std::wstring& name, bool read_only, bool open_existing,
+ bool Create(const std::string& name, bool read_only, bool open_existing,
uint32 size);
// Deletes resources associated with a shared memory segment based on name.
// Not all platforms require this call.
- bool Delete(const std::wstring& name);
+ bool Delete(const std::string& name);
// Opens a shared memory segment based on a name.
// If read_only is true, opens for read-only access.
// If name is the empty string, use a unique name.
// Returns true on success, false on failure.
- bool Open(const std::wstring& name, bool read_only);
+ bool Open(const std::string& name, bool read_only);
// Maps the shared memory into the caller's address space.
// Returns true on success, false otherwise. The memory address
@@ -161,10 +161,9 @@ class SharedMemory {
private:
#if defined(OS_POSIX)
- bool CreateOrOpen(const std::wstring &name, int posix_flags, uint32 size);
- bool FilePathForMemoryName(const std::wstring& memname, FilePath* path);
+ bool CreateOrOpen(const std::string& name, int posix_flags, uint32 size);
+ bool FilePathForMemoryName(const std::string& mem_name, FilePath* path);
void LockOrUnlockCommon(int function);
-
#endif
bool ShareToProcessCommon(ProcessHandle process,
SharedMemoryHandle* new_handle,
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index 2dae8af..32b3dae7 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -77,7 +77,7 @@ void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
close(handle.fd);
}
-bool SharedMemory::Create(const std::wstring &name, bool read_only,
+bool SharedMemory::Create(const std::string& name, bool read_only,
bool open_existing, uint32 size) {
read_only_ = read_only;
@@ -96,7 +96,7 @@ bool SharedMemory::Create(const std::wstring &name, bool read_only,
// Our current implementation of shmem is with mmap()ing of files.
// These files need to be deleted explicitly.
// In practice this call is only needed for unit tests.
-bool SharedMemory::Delete(const std::wstring& name) {
+bool SharedMemory::Delete(const std::string& name) {
FilePath path;
if (!FilePathForMemoryName(name, &path))
return false;
@@ -109,7 +109,7 @@ bool SharedMemory::Delete(const std::wstring& name) {
return true;
}
-bool SharedMemory::Open(const std::wstring &name, bool read_only) {
+bool SharedMemory::Open(const std::string& name, bool read_only) {
read_only_ = read_only;
int posix_flags = 0;
@@ -118,22 +118,21 @@ bool SharedMemory::Open(const std::wstring &name, bool read_only) {
return CreateOrOpen(name, posix_flags, 0);
}
-// For the given shmem named |memname|, return a filename to mmap()
+// For the given shmem named |mem_name|, return a filename to mmap()
// (and possibly create). Modifies |filename|. Return false on
// error, or true of we are happy.
-bool SharedMemory::FilePathForMemoryName(const std::wstring& memname,
+bool SharedMemory::FilePathForMemoryName(const std::string& mem_name,
FilePath* path) {
// mem_name will be used for a filename; make sure it doesn't
// contain anything which will confuse us.
- DCHECK(memname.find_first_of(L"/") == std::string::npos);
- DCHECK(memname.find_first_of(L"\0") == std::string::npos);
+ DCHECK(mem_name.find('/') == std::string::npos);
+ DCHECK(mem_name.find('\0') == std::string::npos);
FilePath temp_dir;
- if (file_util::GetShmemTempDir(&temp_dir) == false)
+ if (!file_util::GetShmemTempDir(&temp_dir))
return false;
- *path = temp_dir.AppendASCII("com.google.chrome.shmem." +
- WideToUTF8(memname));
+ *path = temp_dir.AppendASCII("com.google.chrome.shmem." + mem_name);
return true;
}
@@ -143,7 +142,7 @@ bool SharedMemory::FilePathForMemoryName(const std::wstring& memname,
// we restart from a crash. (That isn't a new problem, but it is a problem.)
// In case we want to delete it later, it may be useful to save the value
// of mem_filename after FilePathForMemoryName().
-bool SharedMemory::CreateOrOpen(const std::wstring &name,
+bool SharedMemory::CreateOrOpen(const std::string& name,
int posix_flags, uint32 size) {
DCHECK(mapped_file_ == -1);
@@ -151,7 +150,7 @@ bool SharedMemory::CreateOrOpen(const std::wstring &name,
FILE *fp;
FilePath path;
- if (name == L"") {
+ if (name.empty()) {
// It doesn't make sense to have a read-only private piece of shmem
DCHECK(posix_flags & (O_RDWR | O_WRONLY));
diff --git a/base/shared_memory_unittest.cc b/base/shared_memory_unittest.cc
index 4e83311..97287fa 100644
--- a/base/shared_memory_unittest.cc
+++ b/base/shared_memory_unittest.cc
@@ -55,13 +55,13 @@ class MultipleThreadMain : public PlatformThread::Delegate {
private:
int16 id_;
- static const wchar_t* const s_test_name_;
+ static const char* const s_test_name_;
DISALLOW_COPY_AND_ASSIGN(MultipleThreadMain);
};
-const wchar_t* const MultipleThreadMain::s_test_name_ =
- L"SharedMemoryOpenThreadTest";
+const char* const MultipleThreadMain::s_test_name_ =
+ "SharedMemoryOpenThreadTest";
// TODO(port):
// This test requires the ability to pass file descriptors between processes.
@@ -82,7 +82,7 @@ class MultipleLockThread : public PlatformThread::Delegate {
SharedMemoryHandle handle = NULL;
{
SharedMemory memory1;
- EXPECT_TRUE(memory1.Create(L"SharedMemoryMultipleLockThreadTest",
+ EXPECT_TRUE(memory1.Create("SharedMemoryMultipleLockThreadTest",
false, true, kDataSize));
EXPECT_TRUE(memory1.ShareToProcess(GetCurrentProcess(), &handle));
// TODO(paulg): Implement this once we have a posix version of
@@ -117,7 +117,7 @@ class MultipleLockThread : public PlatformThread::Delegate {
TEST(SharedMemoryTest, OpenClose) {
const uint32 kDataSize = 1024;
- std::wstring test_name = L"SharedMemoryOpenCloseTest";
+ std::string test_name = "SharedMemoryOpenCloseTest";
// Open two handles to a memory segment, confirm that they are mapped
// separately yet point to the same space.
@@ -243,7 +243,7 @@ TEST(SharedMemoryTest, AnonymousPrivate) {
ASSERT_TRUE(pointers.get());
for (i = 0; i < count; i++) {
- rv = memories[i].Create(L"", false, true, kDataSize);
+ rv = memories[i].Create("", false, true, kDataSize);
EXPECT_TRUE(rv);
rv = memories[i].Map(kDataSize);
EXPECT_TRUE(rv);
@@ -314,10 +314,10 @@ class SharedMemoryProcessTest : public base::MultiProcessTest {
}
private:
- static const wchar_t* const s_test_name_;
+ static const char* const s_test_name_;
};
-const wchar_t* const SharedMemoryProcessTest::s_test_name_ = L"MPMem";
+const char* const SharedMemoryProcessTest::s_test_name_ = "MPMem";
TEST_F(SharedMemoryProcessTest, Tasks) {
diff --git a/base/shared_memory_win.cc b/base/shared_memory_win.cc
index 7974e14..f35ada1 100644
--- a/base/shared_memory_win.cc
+++ b/base/shared_memory_win.cc
@@ -5,6 +5,7 @@
#include "base/shared_memory.h"
#include "base/logging.h"
+#include "base/utf_string_conversions.h"
namespace base {
@@ -60,7 +61,7 @@ void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
::CloseHandle(handle);
}
-bool SharedMemory::Create(const std::wstring &name, bool read_only,
+bool SharedMemory::Create(const std::string& name, bool read_only,
bool open_existing, uint32 size) {
DCHECK(mapped_file_ == NULL);
@@ -70,12 +71,12 @@ bool SharedMemory::Create(const std::wstring &name, bool read_only,
// To avoid client impact, we continue to retain the size as the
// actual requested size.
uint32 rounded_size = (size + 0xffff) & ~0xffff;
- name_ = name;
+ name_ = ASCIIToWide(name);
read_only_ = read_only;
mapped_file_ = CreateFileMapping(INVALID_HANDLE_VALUE, NULL,
read_only_ ? PAGE_READONLY : PAGE_READWRITE, 0,
static_cast<DWORD>(rounded_size),
- name.empty() ? NULL : name.c_str());
+ name_.empty() ? NULL : name_.c_str());
if (!mapped_file_)
return false;
@@ -88,19 +89,19 @@ bool SharedMemory::Create(const std::wstring &name, bool read_only,
return true;
}
-bool SharedMemory::Delete(const std::wstring& name) {
+bool SharedMemory::Delete(const std::string& name) {
// intentionally empty -- there is nothing for us to do on Windows.
return true;
}
-bool SharedMemory::Open(const std::wstring &name, bool read_only) {
+bool SharedMemory::Open(const std::string& name, bool read_only) {
DCHECK(mapped_file_ == NULL);
- name_ = name;
+ name_ = ASCIIToWide(name);
read_only_ = read_only;
mapped_file_ = OpenFileMapping(
read_only_ ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS, false,
- name.empty() ? NULL : name.c_str());
+ name_.empty() ? NULL : name_.c_str());
if (mapped_file_ != NULL) {
// Note: size_ is not set in this case.
return true;
diff --git a/base/stats_table.cc b/base/stats_table.cc
index 2edbb44..2ef78e8 100644
--- a/base/stats_table.cc
+++ b/base/stats_table.cc
@@ -170,7 +170,7 @@ StatsTablePrivate* StatsTablePrivate::New(const std::string& name,
int max_threads,
int max_counters) {
scoped_ptr<StatsTablePrivate> priv(new StatsTablePrivate());
- if (!priv->shared_memory_.Create(UTF8ToWide(name), false, true, size))
+ if (!priv->shared_memory_.Create(name, false, true, size))
return NULL;
if (!priv->shared_memory_.Map(size))
return NULL;
diff --git a/base/stats_table_unittest.cc b/base/stats_table_unittest.cc
index 4fd79b5..f926f29 100644
--- a/base/stats_table_unittest.cc
+++ b/base/stats_table_unittest.cc
@@ -23,9 +23,9 @@ namespace base {
class StatsTableTest : public MultiProcessTest {
public:
- void DeleteShmem(std::string name) {
+ void DeleteShmem(const std::string& name) {
base::SharedMemory mem;
- mem.Delete(UTF8ToWide(name));
+ mem.Delete(name);
}
};
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 7461a87..6605936 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -253,7 +253,7 @@ static base::SharedMemory* Serialize(const UserScriptList& scripts) {
// Create the shared memory object.
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
- if (!shared_memory->Create(std::wstring(), // anonymous
+ if (!shared_memory->Create(std::string(), // anonymous
false, // read-only
false, // open existing
pickle.size()))
diff --git a/chrome/browser/renderer_host/async_resource_handler.cc b/chrome/browser/renderer_host/async_resource_handler.cc
index 803b91b..f9517a2 100644
--- a/chrome/browser/renderer_host/async_resource_handler.cc
+++ b/chrome/browser/renderer_host/async_resource_handler.cc
@@ -46,7 +46,7 @@ class SharedIOBuffer : public net::IOBuffer {
buffer_size_(buffer_size) {}
bool Init() {
- if (shared_memory_.Create(std::wstring(), false, false, buffer_size_) &&
+ if (shared_memory_.Create(std::string(), false, false, buffer_size_) &&
shared_memory_.Map(buffer_size_)) {
data_ = reinterpret_cast<char*>(shared_memory_.memory());
DCHECK(data_);
diff --git a/chrome/browser/renderer_host/audio_renderer_host.cc b/chrome/browser/renderer_host/audio_renderer_host.cc
index 13ca7aa..96b4999 100644
--- a/chrome/browser/renderer_host/audio_renderer_host.cc
+++ b/chrome/browser/renderer_host/audio_renderer_host.cc
@@ -331,7 +331,7 @@ void AudioRendererHost::OnCreateStream(
scoped_ptr<AudioEntry> entry(new AudioEntry());
// Create the shared memory and share with the renderer process.
- if (!entry->shared_memory.Create(L"", false, false, hardware_packet_size) ||
+ if (!entry->shared_memory.Create("", false, false, hardware_packet_size) ||
!entry->shared_memory.Map(entry->shared_memory.max_size())) {
// If creation of shared memory failed then send an error message.
SendErrorMessage(msg.routing_id(), stream_id);
diff --git a/chrome/browser/renderer_host/render_sandbox_host_linux.cc b/chrome/browser/renderer_host/render_sandbox_host_linux.cc
index bcd63d8..5292d95 100644
--- a/chrome/browser/renderer_host/render_sandbox_host_linux.cc
+++ b/chrome/browser/renderer_host/render_sandbox_host_linux.cc
@@ -360,7 +360,7 @@ class SandboxIPCProcess {
return;
int shm_fd = -1;
base::SharedMemory shm;
- if (shm.Create(L"", false, false, shm_size))
+ if (shm.Create("", false, false, shm_size))
shm_fd = shm.handle().fd;
Pickle reply;
SendRendererReply(fds, reply, shm_fd);
diff --git a/chrome/browser/renderer_host/render_widget_helper.cc b/chrome/browser/renderer_host/render_widget_helper.cc
index 718a723..286fa42 100644
--- a/chrome/browser/renderer_host/render_widget_helper.cc
+++ b/chrome/browser/renderer_host/render_widget_helper.cc
@@ -290,7 +290,7 @@ TransportDIB* RenderWidgetHelper::MapTransportDIB(TransportDIB::Id dib_id) {
void RenderWidgetHelper::AllocTransportDIB(
size_t size, bool cache_in_browser, TransportDIB::Handle* result) {
scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
- if (!shared_memory->Create(L"", false /* read write */,
+ if (!shared_memory->Create("", false /* read write */,
false /* do not open existing */, size)) {
result->fd = -1;
result->auto_close = false;
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 21264f2..1bfe307 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -1035,7 +1035,7 @@ void ResourceMessageFilter::OnAllocateSharedMemoryBuffer(
uint32 buffer_size,
base::SharedMemoryHandle* handle) {
base::SharedMemory shared_buf;
- shared_buf.Create(L"", false, false, buffer_size);
+ shared_buf.Create("", false, false, buffer_size);
if (!shared_buf.Map(buffer_size)) {
*handle = base::SharedMemory::NULLHandle();
NOTREACHED() << "Cannot map shared memory buffer";
diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc
index 7e4d553..6eec909 100644
--- a/chrome/browser/visitedlink_master.cc
+++ b/chrome/browser/visitedlink_master.cc
@@ -670,7 +670,7 @@ bool VisitedLinkMaster::CreateURLTable(int32 num_entries, bool init_to_empty) {
if (!shared_memory_)
return false;
- if (!shared_memory_->Create(std::wstring() /* anonymous */,
+ if (!shared_memory_->Create(std::string() /* anonymous */,
false /* read-write */, false /* create */,
alloc_size)) {
return false;
diff --git a/chrome/common/font_loader_mac.mm b/chrome/common/font_loader_mac.mm
index 849ae87..b88bffe 100644
--- a/chrome/common/font_loader_mac.mm
+++ b/chrome/common/font_loader_mac.mm
@@ -66,7 +66,7 @@ bool FontLoader::LoadFontIntoBuffer(NSFont* font_to_encode,
}
int32 font_file_size_32 = static_cast<int32>(font_file_size_64);
- if (!font_data->Create(L"", false, false, font_file_size_32)) {
+ if (!font_data->Create("", false, false, font_file_size_32)) {
LOG(ERROR) << "Failed to create shmem area for " << font_name;
return false;
}
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index 4b138eb..ff007f9 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -119,8 +119,8 @@ class ResourceDispatcherTest : public testing::Test,
// received data message with the test contents
base::SharedMemory shared_mem;
- EXPECT_TRUE(shared_mem.Create(std::wstring(),
- false, false, test_page_contents_len));
+ EXPECT_TRUE(shared_mem.Create(std::string(), false, false,
+ test_page_contents_len));
EXPECT_TRUE(shared_mem.Map(test_page_contents_len));
char* put_data_here = static_cast<char*>(shared_mem.memory());
memcpy(put_data_here, test_page_contents, test_page_contents_len);
@@ -297,7 +297,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
protected:
virtual void SetUp() {
- EXPECT_EQ(true, shared_handle_.Create(L"DeferredResourceLoaderTest", false,
+ EXPECT_EQ(true, shared_handle_.Create("DeferredResourceLoaderTest", false,
false, 100));
ResourceDispatcherTest::SetUp();
}
diff --git a/chrome/common/sandbox_mac_fontloading_unittest.mm b/chrome/common/sandbox_mac_fontloading_unittest.mm
index a20d263..f07a444 100644
--- a/chrome/common/sandbox_mac_fontloading_unittest.mm
+++ b/chrome/common/sandbox_mac_fontloading_unittest.mm
@@ -91,7 +91,7 @@ bool FontLoadingTestCase::BeforeSandboxInit() {
return false;
}
- if (!font_shmem_->Create(L"", false, false, font_data_length_)) {
+ if (!font_shmem_->Create("", false, false, font_data_length_)) {
LOG(ERROR) << "SharedMemory::Create failed";
return false;
}
diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc
index 71ce991..a7877a0 100644
--- a/chrome/gpu/gpu_video_decoder.cc
+++ b/chrome/gpu/gpu_video_decoder.cc
@@ -43,7 +43,7 @@ bool GpuVideoDecoder::CreateInputTransferBuffer(
if (!input_transfer_buffer_.get())
return false;
- if (!input_transfer_buffer_->Create(std::wstring(), false, false, size))
+ if (!input_transfer_buffer_->Create(std::string(), false, false, size))
return false;
if (!input_transfer_buffer_->Map(size))
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 17f0222..39282a1 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -422,7 +422,7 @@ void WebPluginDelegateStub::CreateSharedBuffer(
uint32 size,
base::SharedMemory* shared_buf,
base::SharedMemoryHandle* remote_handle) {
- if (!shared_buf->Create(std::wstring(), false, false, size)) {
+ if (!shared_buf->Create(std::string(), false, false, size)) {
NOTREACHED();
return;
}
diff --git a/chrome/renderer/media/audio_renderer_impl_unittest.cc b/chrome/renderer/media/audio_renderer_impl_unittest.cc
index e6e4569..632da5e 100644
--- a/chrome/renderer/media/audio_renderer_impl_unittest.cc
+++ b/chrome/renderer/media/audio_renderer_impl_unittest.cc
@@ -29,7 +29,7 @@ class AudioRendererImplTest : public ::testing::Test {
filter_->message_loop_ = message_loop_.get();
// Create temporary shared memory.
- CHECK(shared_mem_.Create(L"", false, false, kSize));
+ CHECK(shared_mem_.Create("", false, false, kSize));
// Setup expectations for initialization.
EXPECT_CALL(callback_, OnFilterCallback());
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index 359b713..454dfbf 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -147,7 +147,7 @@ void MockRenderThread::OnDuplicateSection(
void MockRenderThread::OnAllocatePDFTransport(
uint32 buffer_size, base::SharedMemoryHandle* handle) {
base::SharedMemory shared_buf;
- shared_buf.Create(L"", false, false, buffer_size);
+ shared_buf.Create("", false, false, buffer_size);
if (!shared_buf.Map(buffer_size)) {
*handle = base::SharedMemory::NULLHandle();
NOTREACHED() << "Cannot map PDF transport buffer";
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index b018655..6815b94 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -142,7 +142,7 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params,
// MB, it can fail to print and not send an error message.
if (buf_size < 350*1024*1024) {
// Allocate a shared memory buffer to hold the generated metafile data.
- if (shared_buf.Create(L"", false, false, buf_size) &&
+ if (shared_buf.Create("", false, false, buf_size) &&
shared_buf.Map(buf_size)) {
// Copy the bits into shared memory.
if (metafile.GetData(shared_buf.memory(), buf_size)) {
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index a17d9c5..20005e8 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -123,7 +123,7 @@ void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
#else // !OS_POSIX
shared_buf_ = new base::SharedMemory;
const bool created = shared_buf_ && shared_buf_->Create(
- L"", false /* read write */, true /* open existing */, buf_size);
+ "", false /* read write */, true /* open existing */, buf_size);
if (!shared_buf_ || !created || !shared_buf_->Map(buf_size)) {
NOTREACHED();
return;
diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
index f632d60..97973f5 100644
--- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
+++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
@@ -140,8 +140,7 @@ void RenderViewFakeResourcesTest::OnRequestResource(
message.routing_id(), request_id, response_head)));
base::SharedMemory shared_memory;
- ASSERT_TRUE(shared_memory.Create(std::wstring(), false,
- false, body.size()));
+ ASSERT_TRUE(shared_memory.Create(std::string(), false, false, body.size()));
ASSERT_TRUE(shared_memory.Map(body.size()));
memcpy(shared_memory.memory(), body.data(), body.size());
diff --git a/chrome/test/unit/chrome_test_suite.cc b/chrome/test/unit/chrome_test_suite.cc
index 4aefaa6..016e582 100644
--- a/chrome/test/unit/chrome_test_suite.cc
+++ b/chrome/test/unit/chrome_test_suite.cc
@@ -32,7 +32,7 @@ static void RemoveSharedMemoryFile(const std::string& filename) {
// on disk.
#if defined(OS_POSIX)
base::SharedMemory memory;
- memory.Delete(UTF8ToWide(filename));
+ memory.Delete(filename);
#endif
}
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 0b9a87b..330e774 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -43,7 +43,7 @@ bool CommandBufferService::Initialize(int32 size) {
num_entries_ = size / sizeof(CommandBufferEntry);
ring_buffer_.reset(new SharedMemory);
- if (ring_buffer_->Create(std::wstring(), false, false, size)) {
+ if (ring_buffer_->Create(std::string(), false, false, size)) {
if (ring_buffer_->Map(size))
return true;
}
@@ -100,7 +100,7 @@ void CommandBufferService::SetGetOffset(int32 get_offset) {
int32 CommandBufferService::CreateTransferBuffer(size_t size) {
linked_ptr<SharedMemory> buffer(new SharedMemory);
- if (!buffer->Create(std::wstring(), false, false, size))
+ if (!buffer->Create(std::string(), false, false, size))
return -1;
if (unused_registered_object_elements_.empty()) {
diff --git a/gpu/command_buffer/service/gpu_processor_unittest.cc b/gpu/command_buffer/service/gpu_processor_unittest.cc
index da2b9e0..f6a2f16 100644
--- a/gpu/command_buffer/service/gpu_processor_unittest.cc
+++ b/gpu/command_buffer/service/gpu_processor_unittest.cc
@@ -30,7 +30,7 @@ class GPUProcessorTest : public testing::Test {
protected:
virtual void SetUp() {
shared_memory_.reset(new ::base::SharedMemory);
- shared_memory_->Create(std::wstring(), false, false, kRingBufferSize);
+ shared_memory_->Create(std::string(), false, false, kRingBufferSize);
shared_memory_->Map(kRingBufferSize);
buffer_ = static_cast<int32*>(shared_memory_->memory());
shared_memory_buffer_.ptr = buffer_;
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index 16fb336..12b3b1c 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -63,7 +63,7 @@ void RemoveSharedMemoryFile(std::string& filename) {
// on disk.
#if defined(OS_POSIX)
base::SharedMemory memory;
- memory.Delete(UTF8ToWide(filename));
+ memory.Delete(filename);
#endif
}