Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/real_pepper_interface.cc

Issue 13951014: [NaCl SDK] nacl_io: opening a node immediately after mounting would fail. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include "nacl_io/real_pepper_interface.h" 6 #include "nacl_io/real_pepper_interface.h"
7 #include <assert.h> 7 #include <assert.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include <ppapi/c/pp_errors.h> 10 #include <ppapi/c/pp_errors.h>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void RealPepperInterface::AddRefResource(PP_Resource resource) { 97 void RealPepperInterface::AddRefResource(PP_Resource resource) {
98 if (resource) 98 if (resource)
99 core_interface_->AddRefResource(resource); 99 core_interface_->AddRefResource(resource);
100 } 100 }
101 101
102 void RealPepperInterface::ReleaseResource(PP_Resource resource) { 102 void RealPepperInterface::ReleaseResource(PP_Resource resource) {
103 if (resource) 103 if (resource)
104 core_interface_->ReleaseResource(resource); 104 core_interface_->ReleaseResource(resource);
105 } 105 }
106 106
107 bool RealPepperInterface::IsMainThread() {
108 return core_interface_->IsMainThread();
109 }
110
107 // Define getter function. 111 // Define getter function.
108 #include "nacl_io/pepper/undef_macros.h" 112 #include "nacl_io/pepper/undef_macros.h"
109 #include "nacl_io/pepper/define_empty_macros.h" 113 #include "nacl_io/pepper/define_empty_macros.h"
110 #undef BEGIN_INTERFACE 114 #undef BEGIN_INTERFACE
111 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 115 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
112 BaseClass* RealPepperInterface::Get##BaseClass() { \ 116 BaseClass* RealPepperInterface::Get##BaseClass() { \
113 return BaseClass##interface_; \ 117 return BaseClass##interface_; \
114 } 118 }
115 #include "nacl_io/pepper/all_interfaces.h" 119 #include "nacl_io/pepper/all_interfaces.h"
116 120
117 121
118 int32_t RealPepperInterface::InitializeMessageLoop() { 122 int32_t RealPepperInterface::InitializeMessageLoop() {
119 int32_t result; 123 int32_t result;
120 PP_Resource message_loop = 0; 124 PP_Resource message_loop = 0;
121 if (core_interface_->IsMainThread()) { 125 if (core_interface_->IsMainThread()) {
122 // TODO(binji): Spin up the main thread's ppapi work thread. 126 // TODO(binji): Spin up the main thread's ppapi work thread.
123 assert(0); 127 assert(0);
124 } else { 128 } else {
125 message_loop = message_loop_interface_->GetCurrent(); 129 message_loop = message_loop_interface_->GetCurrent();
126 if (!message_loop) { 130 if (!message_loop) {
127 message_loop = message_loop_interface_->Create(instance_); 131 message_loop = message_loop_interface_->Create(instance_);
128 result = message_loop_interface_->AttachToCurrentThread(message_loop); 132 result = message_loop_interface_->AttachToCurrentThread(message_loop);
129 assert(result == PP_OK); 133 assert(result == PP_OK);
130 } 134 }
131 } 135 }
132 136
133 return PP_OK; 137 return PP_OK;
134 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698