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

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

Issue 8849003: Rename the shared_impl resource files to give them more regular names. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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/char_set_impl.cc ('k') | ppapi/shared_impl/file_ref_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/rand_util.h"
6 #include "ppapi/c/dev/ppb_crypto_dev.h"
7 #include "ppapi/thunk/thunk.h"
8
9 // The crypto interface doesn't have a normal C -> C++ thunk since it doesn't
10 // actually have any proxy wrapping or associated objects; it's just a call
11 // into base. So we implement the entire interface here, using the thunk
12 // namespace so it magically gets hooked up in the proper places.
13
14 namespace ppapi {
15
16 namespace {
17
18 void GetRandomBytes(char* buffer, uint32_t num_bytes) {
19 base::RandBytes(buffer, num_bytes);
20 }
21
22 const PPB_Crypto_Dev crypto_interface = {
23 &GetRandomBytes
24 };
25
26 } // namespace
27
28 namespace thunk {
29
30 PPAPI_THUNK_EXPORT const PPB_Crypto_Dev* GetPPB_Crypto_Dev_Thunk() {
31 return &crypto_interface;
32 }
33
34 } // namespace thunk
35
36 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/char_set_impl.cc ('k') | ppapi/shared_impl/file_ref_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698