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

Side by Side Diff: Source/bindings/v8/custom/V8PannerNodeCustom.cpp

Issue 113213002: Rename toWebCoreString*() utility methods to toCoreString*() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep "to" prefix Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 if (value->IsNumber()) { 38 if (value->IsNumber()) {
39 bool ok = false; 39 bool ok = false;
40 uint32_t model = toUInt32(value, ok); 40 uint32_t model = toUInt32(value, ok);
41 ASSERT(ok); 41 ASSERT(ok);
42 if (!imp->setPanningModel(model)) 42 if (!imp->setPanningModel(model))
43 throwTypeError("Illegal panningModel", info.GetIsolate()); 43 throwTypeError("Illegal panningModel", info.GetIsolate());
44 return; 44 return;
45 } 45 }
46 46
47 if (value->IsString()) { 47 if (value->IsString()) {
48 String model = toWebCoreString(value.As<v8::String>()); 48 String model = toCoreString(value.As<v8::String>());
49 if (model == "equalpower" || model == "HRTF" || model == "soundfield") { 49 if (model == "equalpower" || model == "HRTF" || model == "soundfield") {
50 imp->setPanningModel(model); 50 imp->setPanningModel(model);
51 return; 51 return;
52 } 52 }
53 } 53 }
54 54
55 throwTypeError("Illegal panningModel", info.GetIsolate()); 55 throwTypeError("Illegal panningModel", info.GetIsolate());
56 } 56 }
57 57
58 void V8PannerNode::distanceModelAttributeSetterCustom(v8::Local<v8::Value> value , const v8::PropertyCallbackInfo<void>& info) 58 void V8PannerNode::distanceModelAttributeSetterCustom(v8::Local<v8::Value> value , const v8::PropertyCallbackInfo<void>& info)
59 { 59 {
60 PannerNode* imp = V8PannerNode::toNative(info.Holder()); 60 PannerNode* imp = V8PannerNode::toNative(info.Holder());
61 61
62 if (value->IsNumber()) { 62 if (value->IsNumber()) {
63 bool ok = false; 63 bool ok = false;
64 uint32_t model = toUInt32(value, ok); 64 uint32_t model = toUInt32(value, ok);
65 ASSERT(ok); 65 ASSERT(ok);
66 if (!imp->setDistanceModel(model)) 66 if (!imp->setDistanceModel(model))
67 throwTypeError("Illegal distanceModel", info.GetIsolate()); 67 throwTypeError("Illegal distanceModel", info.GetIsolate());
68 return; 68 return;
69 } 69 }
70 70
71 if (value->IsString()) { 71 if (value->IsString()) {
72 String model = toWebCoreString(value.As<v8::String>()); 72 String model = toCoreString(value.As<v8::String>());
73 if (model == "linear" || model == "inverse" || model == "exponential") { 73 if (model == "linear" || model == "inverse" || model == "exponential") {
74 imp->setDistanceModel(model); 74 imp->setDistanceModel(model);
75 return; 75 return;
76 } 76 }
77 } 77 }
78 78
79 throwTypeError("Illegal distanceModel", info.GetIsolate()); 79 throwTypeError("Illegal distanceModel", info.GetIsolate());
80 } 80 }
81 81
82 } // namespace WebCore 82 } // namespace WebCore
83 83
84 #endif // ENABLE(WEB_AUDIO) 84 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp ('k') | Source/bindings/v8/custom/V8WindowCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698