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

Side by Side Diff: ppapi/shared_impl/ppb_instance_shared.cc

Issue 11416214: PPAPI: Move PPB_Console out of dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 years 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
« no previous file with comments | « ppapi/shared_impl/ppb_instance_shared.h ('k') | ppapi/shared_impl/resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ppapi/shared_impl/ppb_instance_shared.h" 5 #include "ppapi/shared_impl/ppb_instance_shared.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/ppb_input_event.h" 10 #include "ppapi/c/ppb_input_event.h"
11 #include "ppapi/shared_impl/ppapi_globals.h" 11 #include "ppapi/shared_impl/ppapi_globals.h"
12 #include "ppapi/shared_impl/ppb_image_data_shared.h" 12 #include "ppapi/shared_impl/ppb_image_data_shared.h"
13 #include "ppapi/shared_impl/var.h" 13 #include "ppapi/shared_impl/var.h"
14 #include "ppapi/thunk/enter.h" 14 #include "ppapi/thunk/enter.h"
15 #include "ppapi/thunk/ppb_image_data_api.h" 15 #include "ppapi/thunk/ppb_image_data_api.h"
16 16
17 namespace ppapi { 17 namespace ppapi {
18 18
19 // static 19 // static
20 const int PPB_Instance_Shared::kExtraCharsForTextInput = 100; 20 const int PPB_Instance_Shared::kExtraCharsForTextInput = 100;
21 21
22 PPB_Instance_Shared::~PPB_Instance_Shared() { 22 PPB_Instance_Shared::~PPB_Instance_Shared() {
23 } 23 }
24 24
25 void PPB_Instance_Shared::Log(PP_Instance instance, 25 void PPB_Instance_Shared::Log(PP_Instance instance,
26 PP_LogLevel_Dev level, 26 PP_LogLevel level,
27 PP_Var value) { 27 PP_Var value) {
28 LogWithSource(instance, level, PP_MakeUndefined(), value); 28 LogWithSource(instance, level, PP_MakeUndefined(), value);
29 } 29 }
30 30
31 void PPB_Instance_Shared::LogWithSource(PP_Instance instance, 31 void PPB_Instance_Shared::LogWithSource(PP_Instance instance,
32 PP_LogLevel_Dev level, 32 PP_LogLevel level,
33 PP_Var source, 33 PP_Var source,
34 PP_Var value) { 34 PP_Var value) {
35 // The source defaults to empty if it's not a string. The PpapiGlobals 35 // The source defaults to empty if it's not a string. The PpapiGlobals
36 // implementation will convert the empty string to the module name if 36 // implementation will convert the empty string to the module name if
37 // possible. 37 // possible.
38 std::string source_str; 38 std::string source_str;
39 if (source.type == PP_VARTYPE_STRING) 39 if (source.type == PP_VARTYPE_STRING)
40 source_str = Var::PPVarToLogString(source); 40 source_str = Var::PPVarToLogString(source);
41 std::string value_str = Var::PPVarToLogString(value); 41 std::string value_str = Var::PPVarToLogString(value);
42 PpapiGlobals::Get()->LogWithSource(instance, level, source_str, value_str); 42 PpapiGlobals::Get()->LogWithSource(instance, level, source_str, value_str);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return false; 92 return false;
93 93
94 // Validate the hot spot location. 94 // Validate the hot spot location.
95 if (hot_spot->x < 0 || hot_spot->x >= desc.size.width || 95 if (hot_spot->x < 0 || hot_spot->x >= desc.size.width ||
96 hot_spot->y < 0 || hot_spot->y >= desc.size.height) 96 hot_spot->y < 0 || hot_spot->y >= desc.size.height)
97 return false; 97 return false;
98 return true; 98 return true;
99 } 99 }
100 100
101 } // namespace ppapi 101 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_instance_shared.h ('k') | ppapi/shared_impl/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698