Commit 9862441f authored by rvargas@chromium.org's avatar rvargas@chromium.org

Remove base::kInvalidPlatformFileValue from Content

BUG=322664

Review URL: https://codereview.chromium.org/316373003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275536 0039d316-1c4b-4281-b951-d872f2087c98
parent 00120d71
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h" #include "base/metrics/sparse_histogram.h"
#include "base/metrics/stats_counters.h" #include "base/metrics/stats_counters.h"
#include "base/platform_file.h"
#include "base/process/process_metrics.h" #include "base/process/process_metrics.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -920,9 +919,13 @@ WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { ...@@ -920,9 +919,13 @@ WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() {
return &fallback_theme_engine_; return &fallback_theme_engine_;
} }
base::PlatformFile BlinkPlatformImpl::databaseOpenFile( blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile(
const blink::WebString& vfs_file_name, int desired_flags) { const blink::WebString& vfs_file_name, int desired_flags) {
return base::kInvalidPlatformFileValue; #if defined(OS_WIN)
return INVALID_HANDLE_VALUE;
#elif defined(OS_POSIX)
return -1;
#endif
} }
int BlinkPlatformImpl::databaseDeleteFile( int BlinkPlatformImpl::databaseDeleteFile(
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/debug/trace_event.h" #include "base/debug/trace_event.h"
#include "base/platform_file.h"
#include "base/threading/thread_local_storage.h" #include "base/threading/thread_local_storage.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "content/child/webcrypto/webcrypto_impl.h" #include "content/child/webcrypto/webcrypto_impl.h"
...@@ -45,7 +44,7 @@ class CONTENT_EXPORT BlinkPlatformImpl ...@@ -45,7 +44,7 @@ class CONTENT_EXPORT BlinkPlatformImpl
// Platform methods (partial implementation): // Platform methods (partial implementation):
virtual blink::WebThemeEngine* themeEngine(); virtual blink::WebThemeEngine* themeEngine();
virtual blink::WebFallbackThemeEngine* fallbackThemeEngine(); virtual blink::WebFallbackThemeEngine* fallbackThemeEngine();
virtual base::PlatformFile databaseOpenFile( virtual blink::Platform::FileHandle databaseOpenFile(
const blink::WebString& vfs_file_name, int desired_flags); const blink::WebString& vfs_file_name, int desired_flags);
virtual int databaseDeleteFile(const blink::WebString& vfs_file_name, virtual int databaseDeleteFile(const blink::WebString& vfs_file_name,
bool sync_dir); bool sync_dir);
......
...@@ -23,7 +23,7 @@ namespace content { ...@@ -23,7 +23,7 @@ namespace content {
namespace { namespace {
base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) { base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) {
base::SyncSocket::Handle out_handle = base::kInvalidPlatformFileValue; base::SyncSocket::Handle out_handle = base::SyncSocket::kInvalidHandle;
#if defined(OS_WIN) #if defined(OS_WIN)
DWORD options = DUPLICATE_SAME_ACCESS; DWORD options = DUPLICATE_SAME_ACCESS;
if (!::DuplicateHandle(::GetCurrentProcess(), if (!::DuplicateHandle(::GetCurrentProcess(),
...@@ -33,7 +33,7 @@ base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) { ...@@ -33,7 +33,7 @@ base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) {
0, 0,
FALSE, FALSE,
options)) { options)) {
out_handle = base::kInvalidPlatformFileValue; out_handle = base::SyncSocket::kInvalidHandle;
} }
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
// If asked to close the source, we can simply re-use the source fd instead of // If asked to close the source, we can simply re-use the source fd instead of
...@@ -188,7 +188,7 @@ void PepperBroker::OnBrokerPermissionResult(PPB_Broker_Impl* client, ...@@ -188,7 +188,7 @@ void PepperBroker::OnBrokerPermissionResult(PPB_Broker_Impl* client,
if (!result) { if (!result) {
// Report failure. // Report failure.
client->BrokerConnected( client->BrokerConnected(
ppapi::PlatformFileToInt(base::kInvalidPlatformFileValue), ppapi::PlatformFileToInt(base::SyncSocket::kInvalidHandle),
PP_ERROR_NOACCESS); PP_ERROR_NOACCESS);
pending_connects_.erase(entry); pending_connects_.erase(entry);
return; return;
...@@ -218,7 +218,7 @@ void PepperBroker::ReportFailureToClients(int error_code) { ...@@ -218,7 +218,7 @@ void PepperBroker::ReportFailureToClients(int error_code) {
base::WeakPtr<PPB_Broker_Impl>& weak_ptr = i->second.client; base::WeakPtr<PPB_Broker_Impl>& weak_ptr = i->second.client;
if (weak_ptr.get()) { if (weak_ptr.get()) {
weak_ptr->BrokerConnected( weak_ptr->BrokerConnected(
ppapi::PlatformFileToInt(base::kInvalidPlatformFileValue), ppapi::PlatformFileToInt(base::SyncSocket::kInvalidHandle),
error_code); error_code);
} }
} }
...@@ -226,7 +226,7 @@ void PepperBroker::ReportFailureToClients(int error_code) { ...@@ -226,7 +226,7 @@ void PepperBroker::ReportFailureToClients(int error_code) {
} }
void PepperBroker::ConnectPluginToBroker(PPB_Broker_Impl* client) { void PepperBroker::ConnectPluginToBroker(PPB_Broker_Impl* client) {
base::SyncSocket::Handle plugin_handle = base::kInvalidPlatformFileValue; base::SyncSocket::Handle plugin_handle = base::SyncSocket::kInvalidHandle;
int32_t result = PP_OK; int32_t result = PP_OK;
// The socket objects will be deleted when this function exits, closing the // The socket objects will be deleted when this function exits, closing the
......
...@@ -31,7 +31,7 @@ PPB_Broker_Impl::PPB_Broker_Impl(PP_Instance instance) ...@@ -31,7 +31,7 @@ PPB_Broker_Impl::PPB_Broker_Impl(PP_Instance instance)
: Resource(ppapi::OBJECT_IS_IMPL, instance), : Resource(ppapi::OBJECT_IS_IMPL, instance),
broker_(NULL), broker_(NULL),
connect_callback_(), connect_callback_(),
pipe_handle_(PlatformFileToInt(base::kInvalidPlatformFileValue)), pipe_handle_(PlatformFileToInt(base::SyncSocket::kInvalidHandle)),
routing_id_(RenderThreadImpl::current()->GenerateRoutingID()) { routing_id_(RenderThreadImpl::current()->GenerateRoutingID()) {
ChildThread::current()->GetRouter()->AddRoute(routing_id_, this); ChildThread::current()->GetRouter()->AddRoute(routing_id_, this);
} }
...@@ -43,7 +43,7 @@ PPB_Broker_Impl::~PPB_Broker_Impl() { ...@@ -43,7 +43,7 @@ PPB_Broker_Impl::~PPB_Broker_Impl() {
} }
// The plugin owns the handle. // The plugin owns the handle.
pipe_handle_ = PlatformFileToInt(base::kInvalidPlatformFileValue); pipe_handle_ = PlatformFileToInt(base::SyncSocket::kInvalidHandle);
ChildThread::current()->GetRouter()->RemoveRoute(routing_id_); ChildThread::current()->GetRouter()->RemoveRoute(routing_id_);
} }
...@@ -95,7 +95,7 @@ int32_t PPB_Broker_Impl::Connect( ...@@ -95,7 +95,7 @@ int32_t PPB_Broker_Impl::Connect(
} }
int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) { int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) {
if (pipe_handle_ == PlatformFileToInt(base::kInvalidPlatformFileValue)) if (pipe_handle_ == PlatformFileToInt(base::SyncSocket::kInvalidHandle))
return PP_ERROR_FAILED; // Handle not set yet. return PP_ERROR_FAILED; // Handle not set yet.
*handle = pipe_handle_; *handle = pipe_handle_;
return PP_OK; return PP_OK;
...@@ -109,9 +109,9 @@ GURL PPB_Broker_Impl::GetDocumentUrl() { ...@@ -109,9 +109,9 @@ GURL PPB_Broker_Impl::GetDocumentUrl() {
// Transfers ownership of the handle to the plugin. // Transfers ownership of the handle to the plugin.
void PPB_Broker_Impl::BrokerConnected(int32_t handle, int32_t result) { void PPB_Broker_Impl::BrokerConnected(int32_t handle, int32_t result) {
DCHECK(pipe_handle_ == PlatformFileToInt(base::kInvalidPlatformFileValue)); DCHECK(pipe_handle_ == PlatformFileToInt(base::SyncSocket::kInvalidHandle));
DCHECK(result == PP_OK || DCHECK(result == PP_OK ||
handle == PlatformFileToInt(base::kInvalidPlatformFileValue)); handle == PlatformFileToInt(base::SyncSocket::kInvalidHandle));
pipe_handle_ = handle; pipe_handle_ = handle;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/platform_file.h"
#include "cc/base/switches.h" #include "cc/base/switches.h"
#include "content/public/browser/browser_main_runner.h" #include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
...@@ -263,7 +262,8 @@ void ShellMainDelegate::InitializeResourceBundle() { ...@@ -263,7 +262,8 @@ void ShellMainDelegate::InitializeResourceBundle() {
// ResourceBundle pak at launch time. // ResourceBundle pak at launch time.
int pak_fd = int pak_fd =
base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor); base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor);
if (pak_fd != base::kInvalidPlatformFileValue) { if (pak_fd >= 0) {
// This is clearly wrong. See crbug.com/330930
ui::ResourceBundle::InitSharedInstanceWithPakFile(base::File(pak_fd), ui::ResourceBundle::InitSharedInstanceWithPakFile(base::File(pak_fd),
false); false);
ResourceBundle::GetSharedInstance().AddDataPackFromFile( ResourceBundle::GetSharedInstance().AddDataPackFromFile(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment