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

Side by Side Diff: ppapi/example/example.cc

Issue 10014013: Add a hang monitor for Pepper plugins (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix leak Created 8 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 #include <math.h> 5 #include <math.h>
6 #include <stdio.h> // FIXME(brettw) erase me. 6 #include <stdio.h> // FIXME(brettw) erase me.
7 #ifndef _WIN32 7 #ifndef _WIN32
8 #include <sys/time.h> 8 #include <sys/time.h>
9 #include <unistd.h>
9 #else 10 #else
10 #include <windows.h> 11 #include <windows.h>
11 #endif 12 #endif
12 #include <time.h> 13 #include <time.h>
13 14
14 #include <algorithm> 15 #include <algorithm>
15 16
16 #include "ppapi/c/dev/ppb_console_dev.h" 17 #include "ppapi/c/dev/ppb_console_dev.h"
17 #include "ppapi/c/dev/ppb_cursor_control_dev.h" 18 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
18 #include "ppapi/c/dev/ppp_printing_dev.h" 19 #include "ppapi/c/dev/ppp_printing_dev.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 184 }
184 185
185 virtual ~MyInstance() { 186 virtual ~MyInstance() {
186 if (fetcher_) { 187 if (fetcher_) {
187 delete fetcher_; 188 delete fetcher_;
188 fetcher_ = NULL; 189 fetcher_ = NULL;
189 } 190 }
190 } 191 }
191 192
192 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) { 193 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) {
194 sleep(15);
yzshen1 2012/04/11 18:30:46 This is not going to be checked in, right? Besides
193 return true; 195 return true;
194 } 196 }
195 197
196 void Log(PP_LogLevel_Dev level, const pp::Var& value) { 198 void Log(PP_LogLevel_Dev level, const pp::Var& value) {
197 const PPB_Console_Dev* console = reinterpret_cast<const PPB_Console_Dev*>( 199 const PPB_Console_Dev* console = reinterpret_cast<const PPB_Console_Dev*>(
198 pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE)); 200 pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE));
199 if (!console) 201 if (!console)
200 return; 202 return;
201 console->Log(pp_instance(), level, value.pp_var()); 203 console->Log(pp_instance(), level, value.pp_var());
202 } 204 }
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 }; 497 };
496 498
497 namespace pp { 499 namespace pp {
498 500
499 // Factory function for your specialization of the Module object. 501 // Factory function for your specialization of the Module object.
500 Module* CreateModule() { 502 Module* CreateModule() {
501 return new MyModule(); 503 return new MyModule();
502 } 504 }
503 505
504 } // namespace pp 506 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698