OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include "native_client/src/trusted/plugin/plugin.h" | 7 #include "native_client/src/trusted/plugin/plugin.h" |
8 | 8 |
9 #include <assert.h> | 9 #include <assert.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 PLUGIN_PRINTF(("Plugin::Init (origin='%s')\n", origin_.c_str())); | 372 PLUGIN_PRINTF(("Plugin::Init (origin='%s')\n", origin_.c_str())); |
373 // Check that origin is in the list of permitted origins. | 373 // Check that origin is in the list of permitted origins. |
374 origin_valid_ = nacl::OriginIsInWhitelist(origin_); | 374 origin_valid_ = nacl::OriginIsInWhitelist(origin_); |
375 // This implementation of same-origin policy does not take | 375 // This implementation of same-origin policy does not take |
376 // document.domain element into account. | 376 // document.domain element into account. |
377 } | 377 } |
378 | 378 |
379 // Set up the scriptable methods for the plugin. | 379 // Set up the scriptable methods for the plugin. |
380 LoadMethods(); | 380 LoadMethods(); |
381 | 381 |
382 // Firefox allows us to call NPN_GetUrl during initialization, so if the "src" | |
Mark Seaborn
2010/08/16 15:13:59
Actually it's NPN_GetURLNotify(). Can you update
gregoryd
2010/08/16 18:41:09
Done.
| |
383 // property has not been specified, we choose a path from the "nexes" list here | |
384 // and start downloading the right nexe immediately. | |
385 #if defined(NACL_STANDALONE) | |
382 // If the <embed src='...'> attr was defined, the browser would have | 386 // If the <embed src='...'> attr was defined, the browser would have |
383 // implicitly called GET on it, which calls Load() and set_logical_url(). | 387 // implicitly called GET on it, which calls Load() and set_logical_url(). |
384 // In the absence of this attr, we use the "nexes" attribute if present. | 388 // In the absence of this attr, we use the "nexes" attribute if present. |
385 if (logical_url() == NULL) { | 389 if (logical_url() == NULL) { |
386 const char* nexes_attr = LookupArgument("nexes"); | 390 const char* nexes_attr = LookupArgument("nexes"); |
387 if (nexes_attr != NULL) { | 391 if (nexes_attr != NULL) { |
388 SetNexesPropertyImpl(nexes_attr); | 392 SetNexesPropertyImpl(nexes_attr); |
389 } | 393 } |
390 } | 394 } |
395 #endif | |
391 | 396 |
392 PLUGIN_PRINTF(("Plugin::Init (return 1)\n")); | 397 PLUGIN_PRINTF(("Plugin::Init (return 1)\n")); |
393 // Return success. | 398 // Return success. |
394 return true; | 399 return true; |
395 } | 400 } |
396 | 401 |
397 Plugin::Plugin() | 402 Plugin::Plugin() |
398 : service_runtime_(NULL), | 403 : service_runtime_(NULL), |
399 receive_thread_running_(false), | 404 receive_thread_running_(false), |
400 argc_(-1), | 405 argc_(-1), |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 | 659 |
655 void VideoGlobalLock() { | 660 void VideoGlobalLock() { |
656 g_VideoMutex.Lock(); | 661 g_VideoMutex.Lock(); |
657 } | 662 } |
658 | 663 |
659 void VideoGlobalUnlock() { | 664 void VideoGlobalUnlock() { |
660 g_VideoMutex.Unlock(); | 665 g_VideoMutex.Unlock(); |
661 } | 666 } |
662 | 667 |
663 } // namespace plugin | 668 } // namespace plugin |
OLD | NEW |